summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJan Kundrát <jkt@flaska.net>2013-04-23 16:03:36 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-24 16:24:40 +0200
commit78fc0d4872bc4908d4615c3975d566fa2e1839eb (patch)
tree3202b496142f4ccac505160e6c31f87748aecf66 /src/plugins
parent4afb128d312a7f2a1d94e2becc5aaaec47326869 (diff)
Respond to the _NET_WM_CONTEXT_HELP WM_PROTOCOLS message
This change restores a proper function of the "(?)" button in the window decorations which is used as a clue for the user to check what a particular widget is supposed to do. The change is only implemented for QtWidgets because the underlying QWhatsThis is inherently widget-specific -- which is why it sends an event to QGuiApplication, but only processes it in the QtWidget-specific QApplication. Thanks to Alberto Mardegan and Gunnar Sletta for their feedback on this patch. Change-Id: Ibb912e3960f1e9aec54c5ed77ade1c6744d6ca23 Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 4090758d36..7d6d6a94b3 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1492,6 +1492,11 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
connection()->setTime(event->data.data32[1]);
m_syncValue.lo = event->data.data32[2];
m_syncValue.hi = event->data.data32[3];
+#ifndef QT_NO_WHATSTHIS
+ } else if (event->data.data32[0] == atom(QXcbAtom::_NET_WM_CONTEXT_HELP)) {
+ QEvent *e = new QEvent(QEvent::EnterWhatsThisMode);
+ QGuiApplication::postEvent(QGuiApplication::instance(), e);
+#endif
} else {
qWarning() << "QXcbWindow: Unhandled WM_PROTOCOLS message:" << connection()->atomName(event->data.data32[0]);
}