summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2012-11-02 11:59:14 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-06 16:35:21 +0100
commit87f16671c3848ffa2d505aaade1b1172176d59fa (patch)
treee587b7bb0ee9e0f3d3a903e519ad9e2fdb8c7a8c
parent3c092b7e584f8af5e1ff39f8e3fc3ee756bee610 (diff)
Send QContexMenuEvent when Context Menu key is pressed.
Bring back code from keymapper_x11.cpp. Task-number: QTBUG-27648 Change-Id: I2a189a0537bcd2ae0eb093576c84814b2f09933b Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index a8542af156..d35ce181e3 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -53,6 +53,7 @@
#include <qpa/qplatforminputcontext.h>
#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformcursor.h>
#ifndef XK_ISO_Left_Tab
#define XK_ISO_Left_Tab 0xFE20
@@ -1106,9 +1107,15 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod
filtered = inputContext->filterEvent(&event);
}
- if (!filtered)
+ if (!filtered) {
+ if (type == QEvent::KeyPress && qtcode == Qt::Key_Menu) {
+ const QPoint globalPos = window->screen()->handle()->cursor()->pos();
+ const QPoint pos = window->mapFromGlobal(globalPos);
+ QWindowSystemInterface::handleContextMenuEvent(window, false, pos, globalPos, modifiers);
+ }
QWindowSystemInterface::handleExtendedKeyEvent(window, time, type, qtcode, modifiers,
code, sym, state, string.left(count), isAutoRepeat);
+ }
if (isAutoRepeat && type == QEvent::KeyRelease) {
// since we removed it from the event queue using checkEvent we need to send the key press here