From 99afd9dd4c6670f1010153a97efdcfa1014042a0 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 23 Jun 2015 13:40:54 +0200 Subject: [PATCH] Fix QAction::setAutoRepeat(false) When cleaning up the shortcut override code, in d7ca800a87a2291c94c6580f0cfe068bb2280caf passing on the autorepeat flags from the native event was accidentally dropped in the call to QWindowSystemInterface::tryHandleShortcutEvent. Task-number: QTBUG-46569 Change-Id: Ib053e11e582de630a1fc1b754f8d10d995c88026 Reviewed-by: Gabriel de Dietrich --- src/gui/kernel/qguiapplication.cpp | 2 +- src/plugins/platforms/cocoa/qnsview.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 6aa1d26c66..8ebddf33a6 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1884,7 +1884,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE #if !defined(Q_OS_OSX) // On OS X the shortcut override is checked earlier, see: QWindowSystemInterface::handleKeyEvent() const bool checkShortcut = e->keyType == QEvent::KeyPress && window != 0; - if (checkShortcut && QWindowSystemInterface::tryHandleShortcutEvent(window, e->timestamp, e->key, e->modifiers, e->unicode)) + if (checkShortcut && QWindowSystemInterface::tryHandleShortcutEvent(window, e->timestamp, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount)) return; #endif // Q_OS_OSX diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 355704ff37..456c9d8c68 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -1431,7 +1431,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) if (eventType == QEvent::KeyPress) { if (m_composingText.isEmpty()) - m_sendKeyEvent = !QWindowSystemInterface::tryHandleShortcutEvent(focusWindow, timestamp, keyCode, modifiers, text); + m_sendKeyEvent = !QWindowSystemInterface::tryHandleShortcutEvent(focusWindow, timestamp, keyCode, modifiers, text, [nsevent isARepeat], 1); QObject *fo = QGuiApplication::focusObject(); if (m_sendKeyEvent && fo) {