mirror of
https://github.com/stablyai/orca.git
synced 2026-09-21 16:02:20 +00:00
* 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>
14 lines
454 B
Swift
14 lines
454 B
Swift
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
|
|
}
|
|
}
|