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>
This commit is contained in:
parent
3c24dddaf9
commit
612953a626
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user