From ac5c64fccd6d491ee3b3a3f54460ed3464d714fc Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 13 Aug 2013 14:49:14 +0200 Subject: 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 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins/platforms/xcb') 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; -- cgit v1.2.3