Skip to content

Commit b87ee30

Browse files
7a6163stonerl
authored andcommitted
style(menubar): remove extra empty lines and fix formatting
1 parent 0856185 commit b87ee30

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

Thaw/MenuBar/MenuBarItems/MenuBarItemImageCache.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,9 @@ final class MenuBarItemImageCache: ObservableObject {
715715
boundsUnion = boundsUnion.union(bounds)
716716
}
717717

718-
guard !windowIDs.isEmpty else {
718+
guard !windowIDs.isEmpty else {
719719
MenuBarItemImageCache.diagLog.debug("refreshImages: no items with bounds, skipping")
720-
return
720+
return
721721
}
722722

723723
guard let compositeImage = ScreenCapture.captureWindows(
@@ -834,7 +834,7 @@ final class MenuBarItemImageCache: ObservableObject {
834834
failureCount: newCount,
835835
lastFailureTime: now
836836
)
837-
837+
838838
// Log when an item reaches blacklist threshold
839839
if newCount == Self.maxFailuresBeforeBlacklist {
840840
MenuBarItemImageCache.diagLog.info(

Thaw/MenuBar/MenuBarItems/MenuBarItemManager.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ final class MenuBarItemManager: ObservableObject {
126126

127127
/// Cached timeouts for move operations.
128128
private var moveOperationTimeouts = [MenuBarItemTag: Duration]()
129-
129+
130130
/// Cached timeouts for click operations (adaptive per app).
131131
private var clickOperationTimeouts = [MenuBarItemTag: Duration]()
132132
/// Storage for internal observers.
@@ -1553,7 +1553,7 @@ extension MenuBarItemManager {
15531553
private func pruneMoveOperationTimeouts(keeping validTags: Set<MenuBarItemTag>) {
15541554
moveOperationTimeouts = moveOperationTimeouts.filter { validTags.contains($0.key) }
15551555
}
1556-
1556+
15571557
/// Returns the default timeout for click operations based on the item's namespace.
15581558
private func getDefaultClickOperationTimeout(for item: MenuBarItem) -> Duration {
15591559
// Known slow apps with dynamic content
@@ -1564,23 +1564,23 @@ extension MenuBarItemManager {
15641564
"com.hegenberg.BetterTouchTool",
15651565
"net.matthewpalmer.Vanilla",
15661566
]
1567-
1567+
15681568
let namespaceString = item.tag.namespace.description
15691569
if slowAppBundleIDs.contains(where: { namespaceString.contains($0) }) {
15701570
return .milliseconds(500) // Extra time for slow apps
15711571
}
1572-
1572+
15731573
return .milliseconds(350) // Default
15741574
}
1575-
1575+
15761576
/// Returns the cached timeout for click operations associated with the given item.
15771577
private func getClickOperationTimeout(for item: MenuBarItem) -> Duration {
15781578
if let timeout = clickOperationTimeouts[item.tag] {
15791579
return timeout
15801580
}
15811581
return getDefaultClickOperationTimeout(for: item)
15821582
}
1583-
1583+
15841584
/// Updates the cached timeout for click operations associated with the given item.
15851585
private func updateClickOperationTimeout(_ duration: Duration, for item: MenuBarItem) {
15861586
let current = getClickOperationTimeout(for: item)
@@ -1589,7 +1589,7 @@ extension MenuBarItemManager {
15891589
clickOperationTimeouts[item.tag] = clamped
15901590
MenuBarItemManager.diagLog.debug("Updated click timeout for \(item.logString): \(Int(clamped.milliseconds))ms (measured: \(Int(duration.milliseconds))ms)")
15911591
}
1592-
1592+
15931593
/// Prunes the click operation timeouts cache, keeping only the entries
15941594
/// for the given valid tags.
15951595
private func pruneClickOperationTimeouts(keeping validTags: Set<MenuBarItemTag>) {
@@ -1920,7 +1920,7 @@ extension MenuBarItemManager {
19201920
let clickTypes = getClickSubtypes(for: mouseButton)
19211921
// Use adaptive timeout based on app performance history
19221922
let timeout = getClickOperationTimeout(for: item)
1923-
1923+
19241924
MenuBarItemManager.diagLog.debug("postClickEvents: using timeout \(Int(timeout.milliseconds))ms for \(item.logString)")
19251925

19261926
guard
@@ -1959,7 +1959,7 @@ extension MenuBarItemManager {
19591959
timeout: timeout,
19601960
repeating: 2 // Double mouse up prevents invalid item state.
19611961
)
1962-
1962+
19631963
// Update timeout cache with successful duration
19641964
let successDuration = Duration.milliseconds(Date.now.timeIntervalSince(eventStartTime) * 1000)
19651965
updateClickOperationTimeout(successDuration, for: item)
@@ -3668,7 +3668,6 @@ private extension Duration {
36683668
let (seconds, attoseconds) = self.components
36693669
return Double(seconds) * 1000 + Double(attoseconds) / 1_000_000_000_000_000
36703670
}
3671-
36723671
}
36733672

36743673
// MARK: - CGEvent Helpers

0 commit comments

Comments
 (0)