Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Sources/Fluid/Services/TypingService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ final class TypingService {
private static let focusSnapshotQueue = DispatchQueue(label: "TypingService.FocusSnapshot")
private static let pasteboardSessionSemaphore = DispatchSemaphore(value: 1)
private static let pasteboardRestoreQueue = DispatchQueue(label: "TypingService.PasteboardRestore", qos: .utility)
private static let pasteboardReadWindowMicros: useconds_t = 200_000
private static var focusSnapshot: FocusSnapshot?

private var textInsertionMode: SettingsStore.TextInsertionMode {
Expand Down Expand Up @@ -940,7 +941,9 @@ final class TypingService {
timeoutMicros: useconds_t
) -> PasteVerificationResult {
guard let snapshot else {
usleep(timeoutMicros)
// timeoutMicros is sized for AX verification; with no snapshot, only the target's pasteboard-read window matters.
let fallbackWaitMicros = min(timeoutMicros, Self.pasteboardReadWindowMicros)
usleep(fallbackWaitMicros)
return .unavailable
}

Expand Down
Loading