summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview_keys.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview_keys.mm')
-rw-r--r--src/plugins/platforms/cocoa/qnsview_keys.mm10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview_keys.mm b/src/plugins/platforms/cocoa/qnsview_keys.mm
index 9ff3a8a762..db2b4f4139 100644
--- a/src/plugins/platforms/cocoa/qnsview_keys.mm
+++ b/src/plugins/platforms/cocoa/qnsview_keys.mm
@@ -93,8 +93,9 @@
qCDebug(lcQpaKeys) << "Handling" << nsevent << "as" << qtKey
<< "with" << modifiers << "and resulting text" << text;
+ QBoolBlocker resendKeyEventGuard(m_resendKeyEvent, false);
// We will send a key event unless the input method sets m_sendKeyEvent to false
- m_sendKeyEvent = true;
+ QBoolBlocker sendKeyEventGuard(m_sendKeyEvent, true);
if (eventType == QEvent::KeyPress) {
@@ -103,10 +104,7 @@
if (QWindowSystemInterface::handleShortcutEvent(window, timestamp, qtKey, modifiers,
nativeScanCode, nativeVirtualKey, nativeModifiers, text, [nsevent isARepeat], 1)) {
qCDebug(lcQpaKeys) << "Found matching shortcut; will not send as key event";
- m_sendKeyEvent = false;
- // Handling a shortcut may result in closing the window
- if (!m_platformWindow)
- return true;
+ return true;
} else {
qCDebug(lcQpaKeys) << "No matching shortcuts; continuing with key event delivery";
}
@@ -157,8 +155,6 @@
nativeScanCode, nativeVirtualKey, nativeModifiers, text, [nsevent isARepeat], 1, false);
accepted = QWindowSystemInterface::flushWindowSystemEvents();
}
- m_sendKeyEvent = false;
- m_resendKeyEvent = false;
return accepted;
}