Fix macOS keyboard actions targeting the wrong app (#3960)
* fix: guard macos synthetic input focus * Tighten macOS keyboard focus safety Co-authored-by: Orca <help@stably.ai> --------- Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com> Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
co-authored by
Orca
Jinwoo-H
parent
885f3c3b25
commit
09872bfe7b
@@ -0,0 +1,13 @@
|
||||
public enum KeyboardInputSafety {
|
||||
public enum FocusFailure: Equatable {
|
||||
case targetNotFocused
|
||||
case targetNotFocusedAfterRestore
|
||||
}
|
||||
|
||||
public static func syntheticInputFocusFailure(targetWindowFocused: Bool, restoreWindowRequested: Bool) -> FocusFailure? {
|
||||
guard !targetWindowFocused else {
|
||||
return nil
|
||||
}
|
||||
return restoreWindowRequested ? .targetNotFocusedAfterRestore : .targetNotFocused
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user