summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2013-08-13 14:49:14 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-16 15:54:30 +0200
commitac5c64fccd6d491ee3b3a3f54460ed3464d714fc (patch)
treec408b67d5152b7524f297de3dd1ff5dae88fd6ba /src/plugins/platforms/xcb
parent2468db75c08d53bcfc82a689a27b3a60f6689313 (diff)
XCB: Ignore _NET_WM_PING on the root window
With a _NET_WM_PING message, a window manager can check if an application still works or if it froze. The WM sends such a message to the application window and the application sends the message back to the root window. Since change Ia04268b0 / commit d8090022f "Move the X11 system tray code from widgets into XCB-plugin.", Qt selects StructureNotifyMask on the root window. Due to this, we now also receive replies to _NET_WM_PING and treat them like a _NET_WM_PING request. This caused an endless loop as soon as any _NET_WM_PING was seen where Qt would send a _NET_WM_PING to itself and handle it again and again. Fix this by ignoring _NET_WM_PING messages that are sent to the root window. According to EWMH, such messages can only be replies to _NET_WM_PING and GTK does this, too. Task-number: QTBUG-32957 Change-Id: I1b0aa682f99b17d633baacc14b18b3adca7a1aba Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index c95c4d95ba..911db83836 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1499,6 +1499,9 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
} else if (event->data.data32[0] == atom(QXcbAtom::WM_TAKE_FOCUS)) {
connection()->setTime(event->data.data32[1]);
} else if (event->data.data32[0] == atom(QXcbAtom::_NET_WM_PING)) {
+ if (event->window == m_screen->root())
+ return;
+
xcb_client_message_event_t reply = *event;
reply.response_type = XCB_CLIENT_MESSAGE;