diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-04-06 08:32:05 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-04-06 08:32:50 (GMT) |
commit | c08089639f540cb61cebc92bc6ad2a587550af47 (patch) | |
tree | 37e8bff626fa63e71ccefb1ac725ee9ccdf402ba /src/plugins/platforms/xcb | |
parent | fc36e189b7654692cdcfcd6098f3c22b15629cb1 (diff) | |
download | Qt-c08089639f540cb61cebc92bc6ad2a587550af47.zip Qt-c08089639f540cb61cebc92bc6ad2a587550af47.tar.gz Qt-c08089639f540cb61cebc92bc6ad2a587550af47.tar.bz2 |
Implemented _NET_WM_PING protocol in XCB backend.
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 1f4a13c..4a9409c 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -169,7 +169,7 @@ QXcbWindow::QXcbWindow(QWidget *tlw) int propertyCount = 0; properties[propertyCount++] = atom(QXcbAtom::WM_DELETE_WINDOW); properties[propertyCount++] = atom(QXcbAtom::WM_TAKE_FOCUS); -// properties[propertyCount++] = atom(QXcbAtom::_NET_WM_PING); + properties[propertyCount++] = atom(QXcbAtom::_NET_WM_PING); if (tlw->windowFlags() & Qt::WindowContextHelpButtonHint) properties[propertyCount++] = atom(QXcbAtom::_NET_WM_CONTEXT_HELP); @@ -466,6 +466,14 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even if (event->format == 32 && event->type == atom(QXcbAtom::WM_PROTOCOLS)) { if (event->data.data32[0] == atom(QXcbAtom::WM_DELETE_WINDOW)) { QWindowSystemInterface::handleCloseEvent(widget()); + } else if (event->data.data32[0] == atom(QXcbAtom::_NET_WM_PING)) { + xcb_client_message_event_t reply = *event; + + reply.response_type = XCB_CLIENT_MESSAGE; + reply.window = m_screen->root(); + + xcb_send_event(xcb_connection(), 0, m_screen->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&reply); + xcb_flush(xcb_connection()); } } } |