summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2015-01-29 16:22:08 +0100
committerShawn Rutledge <shawn.rutledge@digia.com>2015-02-05 14:55:10 +0000
commit612953a626ec21b8518ee23a4f5268b566cf41e5 (patch)
tree2c8795e460f3b99bc5be52c54620aff69f932bf6
parent3c24dddaf963026c6e3cd90dd7d538dfa8044c83 (diff)
xcb: delay showing tray icon window until it is embedded
Otherwise there is a race condition: when the tray implementation gets around to embedding the window, if it was already shown, it will be unmapped, embedded, and then remapped. Some tray implementations will resize the tray icon to 1 pixel wide in that case. We also never want to show a window that was intended for the tray in any other location, so it's better that it remain invisible until we are sure it is embedded. Task-number: QTBUG-31762 Task-number: QTBUG-35658 Task-number: QTBUG-32811 Change-Id: Id324b0bfded0f8258ff1686a223cb2c069827d42 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 4fd71f1635..96c5663d83 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -755,6 +755,9 @@ void QXcbWindow::show()
if (connection()->time() != XCB_TIME_CURRENT_TIME)
updateNetWmUserTime(connection()->time());
+ if (window()->objectName() == QLatin1String("QSystemTrayIconSysWindow"))
+ return; // defer showing until XEMBED_EMBEDDED_NOTIFY
+
Q_XCB_CALL(xcb_map_window(xcb_connection(), m_window));
if (QGuiApplication::modalWindow() == window())
@@ -2338,7 +2341,10 @@ void QXcbWindow::handleXEmbedMessage(const xcb_client_message_event_t *event)
switch (event->data.data32[1]) {
case XEMBED_WINDOW_ACTIVATE:
case XEMBED_WINDOW_DEACTIVATE:
+ break;
case XEMBED_EMBEDDED_NOTIFY:
+ Q_XCB_CALL(xcb_map_window(xcb_connection(), m_window));
+ m_screen->windowShown(this);
break;
case XEMBED_FOCUS_IN:
Qt::FocusReason reason;