From f2a2800b37f91069959dad74d4cd186f72e57695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 12 Sep 2022 13:35:22 +0200 Subject: QWSI: Remove dead code for macOS-specific shortcut-override handling The macOS platform plugin exclusively uses handleExtendedKeyEvent() these days, never the simpler handleKeyEvent(), and always passes false for the tryShortcutOverride argument, so the special-cased code was never executed. No other platform passes the optional tryShortcutOverride argument, so it can be removed completely. If we ever need to bring back this kind of logic it should live in the macOS platform plugin, not in the QWSI layer. We have to keep the existing logic for qt_handleKeyEvent() though, as that's exercised through QTest::simulateEvent(). The next step would be to remove the QWindowSystemInterface::handleShortcutEvent() call in QGuiApplicationPrivate::processKeyEvent() and teach existing platform plugins, as well as the QTest machinery, to handle shortcuts explicitly before sending raw key events. Change-Id: I6eb3fd18c64d1619e33e79f076e25efd299a9ba7 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qnsview_keys.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qnsview_keys.mm b/src/plugins/platforms/cocoa/qnsview_keys.mm index dc669d6f3b..49bbe2308a 100644 --- a/src/plugins/platforms/cocoa/qnsview_keys.mm +++ b/src/plugins/platforms/cocoa/qnsview_keys.mm @@ -250,10 +250,9 @@ bool KeyEvent::sendWindowSystemEvent(QWindow *window) const case QEvent::KeyPress: case QEvent::KeyRelease: { static const int count = 1; - static const bool tryShortcutOverride = false; QWindowSystemInterface::handleExtendedKeyEvent(window, timestamp, type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, - text, isRepeat, count, tryShortcutOverride); + text, isRepeat, count); // FIXME: Make handleExtendedKeyEvent synchronous return QWindowSystemInterface::flushWindowSystemEvents(); } -- cgit v1.2.3