Skip to content

Commit 7c10dcf

Browse files
committed
Fix overlay dimming when Xcode is not active
1 parent 8db2391 commit 7c10dcf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

OverlayWindow/Sources/OverlayWindow/OverlayWindowController.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,19 @@ private extension OverlayWindowController {
5656
withPerceptionTracking {
5757
_ = XcodeInspector.shared.focusedWindow
5858
_ = XcodeInspector.shared.activeXcode
59+
_ = XcodeInspector.shared.activeApplication
5960
} onChange: { [weak self] in
6061
guard let self else { return }
6162
Task { @MainActor in
6263
defer { self.observeWindowChange() }
6364

65+
guard XcodeInspector.shared.activeApplication?.isXcode ?? false else {
66+
for (_, controller) in self.ideWindowOverlayWindowControllers {
67+
controller.dim()
68+
}
69+
return
70+
}
71+
6472
guard let app = XcodeInspector.shared.activeXcode else {
6573
for (_, controller) in self.ideWindowOverlayWindowControllers {
6674
controller.hide()

0 commit comments

Comments
 (0)