Skip to content

Commit

Permalink
Increase timeout and fallback sleep interval in menu bar item frame c…
Browse files Browse the repository at this point in the history
…heck
  • Loading branch information
jordanbaird committed Aug 25, 2024
1 parent d970e0a commit 90be44b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Ice/MenuBar/MenuBarItemManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,11 @@ extension MenuBarItemManager {
try await forwardEvent(event, from: initialLocation, to: forwardedLocation, item: item)
Logger.itemManager.warning("Couldn't get menu bar item frame for \(item.logString), so using fixed delay")
// This will be slow, but subsequent events will have a better chance of succeeding.
try await Task.sleep(for: .milliseconds(50))
try await Task.sleep(for: .milliseconds(100))
return
}
try await forwardEvent(event, from: initialLocation, to: forwardedLocation, item: item)
try await waitForFrameChange(of: item, initialFrame: currentFrame, timeout: .milliseconds(50))
try await waitForFrameChange(of: item, initialFrame: currentFrame, timeout: .milliseconds(100))
}

/// Waits for a menu bar item's frame to change from an initial frame.
Expand Down Expand Up @@ -661,7 +661,7 @@ extension MenuBarItemManager {
} catch is FrameCheckCancellationError {
Logger.itemManager.warning("Menu bar item frame check for \(item.logString) was cancelled, so using fixed delay")
// This will be slow, but subsequent events will have a better chance of succeeding.
try await Task.sleep(for: .milliseconds(50))
try await Task.sleep(for: .milliseconds(100))
} catch is TaskTimeoutError {
throw EventError(code: .timeout, item: item)
}
Expand Down

0 comments on commit 90be44b

Please sign in to comment.