From 3761e9682e1f47adb36cafa3bdd26518fabf338f Mon Sep 17 00:00:00 2001 From: Louis Pontoise Date: Mon, 5 Oct 2020 21:05:17 +0900 Subject: [PATCH] fix: space transition sometimes absorbed the shortcut (closes #588) --- src/logic/ATShortcut.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/logic/ATShortcut.swift b/src/logic/ATShortcut.swift index b24cfd77c..d02f2caca 100644 --- a/src/logic/ATShortcut.swift +++ b/src/logic/ATShortcut.swift @@ -25,6 +25,11 @@ class ATShortcut { state = state == .down ? .up : .down if state == .up { KeyRepeatTimer.timer?.invalidate() + } else { + // macOS bug: the app doesn't receive either local or global modifierChanged events during Space transition + // we force holdShortcut to be .down if nextWindowShortcut trigger during a transition, since we know it has to be down at that point + let suffix = shortcutId == "nextWindowShortcut" ? "" : "2" + ControlsTab.shortcuts["holdShortcut" + suffix]!.state = .down } if (triggerPhase == .down && shortcutState == .down) || (triggerPhase == .up && shortcutState == .up) { return true