Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.1
-
None
-
-
fee9011f8 (dev), b8eff8bab (6.6), 31264d90f (6.5)
Description
The keyinput QML auto test fails in qtapplicationmanager in multi-process mode when a debug build is used with ASSERT: "nativeScanCode >= offset" in file qtwayland/src/compositor/compositor_api/qwaylandkeyboard.cpp (the test has been disabled for now). The problem was introduced with https://codereview.qt-project.org/c/qt/qtbase/+/454426. With this patch the injected key events by the TestCase type take a different code path (through QWindowSystemInterfacePrivate::eventHandler->sendEvent instead of QGuiApplicationPrivate::processWindowSystemEvent directly). Hence the key events don't got through QWaylandSeat::sendFullKeyEvent any more that would call keyToScanCode which calculates a proper scanCode.
This would fix the problem:
--- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -101,6 +101,8 @@ public: ke->nativeScanCode += offset; #endif uint32_t code = ke->nativeScanCode; + if (code == 0) + code = seat->keyboard()->keyToScanCode(ke->key); bool isDown = ke->keyType == QEvent::KeyPress; #if QT_CONFIG(xkbcommon)
The issue can be reproduced more easily with qmltestrunner and the attached test (though might hang on Wayland desktops as a subsequent problem). The question is, how this should properly be solved.