From 7dfa3f9d50feeb9525d832057cdc804f082ad3bd Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 20 Sep 2019 10:38:34 +0200 Subject: [PATCH 1/2] Fix wrong target name for tst_client_fullscreenshellv1 Task-number: QTBUG-78177 Change-Id: Id44794523511241b408e79383e438e52f769d62a Reviewed-by: Pier Luigi Fiorini --- tests/auto/wayland/fullscreenshellv1/fullscreenshellv1.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/wayland/fullscreenshellv1/fullscreenshellv1.pro b/tests/auto/wayland/fullscreenshellv1/fullscreenshellv1.pro index 49d19d5c30d..c4006cdd870 100644 --- a/tests/auto/wayland/fullscreenshellv1/fullscreenshellv1.pro +++ b/tests/auto/wayland/fullscreenshellv1/fullscreenshellv1.pro @@ -1,4 +1,4 @@ include (../shared_old/shared_old.pri) -TARGET = tst_client_fullscreenshell1 +TARGET = tst_client_fullscreenshellv1 SOURCES += tst_fullscreenshellv1.cpp From 235f8f12fa1163cb7d149b71522a58247ee96e5f Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 13 Sep 2019 15:31:49 +0200 Subject: [PATCH 2/2] Client: Create context menu event when pressing the menu key Effectively is a copy of the code in XCB. When the menu key is pressed, a context menu event should be generated at the current cursor position. The global position in the event isn't truly global as that doesn't exist in wayland but should match client expectations. Change-Id: Ib814883aba632ca5eec58730846e1762b680467f Reviewed-by: Johan Helsing --- .../platforms/wayland/qwaylandinputdevice.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index e39ccf25ee2..a9da452dcbd 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -1158,7 +1158,18 @@ void QWaylandInputDevice::Keyboard::handleKey(ulong timestamp, QEvent::Type type } if (!filtered) { - QWindowSystemInterface::handleExtendedKeyEvent(focusWindow()->window(), timestamp, type, key, modifiers, + auto window = focusWindow()->window(); + + if (type == QEvent::KeyPress && key == Qt::Key_Menu) { + auto cursor = window->screen()->handle()->cursor(); + if (cursor) { + const QPoint globalPos = cursor->pos(); + const QPoint pos = window->mapFromGlobal(globalPos); + QWindowSystemInterface::handleContextMenuEvent(window, false, pos, globalPos, modifiers); + } + } + + QWindowSystemInterface::handleExtendedKeyEvent(window, timestamp, type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorepeat, count); } }