Skip to content

Commit 6fb6360

Browse files
committed
Hide the circle when Xcode is not active
1 parent 01c7cad commit 6fb6360

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

Core/Sources/SuggestionWidget/WidgetWindowsController.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ actor WidgetWindowsController: NSObject {
9393
let xcodeInspector = self.xcodeInspector
9494
let activeApp = await xcodeInspector.safe.activeApplication
9595
let latestActiveXcode = await xcodeInspector.safe.latestActiveXcode
96+
let previousActiveApplication = xcodeInspector.previousActiveApplication
9697
await MainActor.run {
9798
let state = store.withState { $0 }
9899
let isChatPanelDetached = state.chatPanelState.chatPanelInASeparateWindow
@@ -123,9 +124,17 @@ actor WidgetWindowsController: NSObject {
123124
return true
124125
}()
125126

127+
let previousAppIsXcode = previousActiveApplication?.isXcode ?? false
128+
126129
windows.sharedPanelWindow.alphaValue = noFocus ? 0 : 1
127130
windows.suggestionPanelWindow.alphaValue = noFocus ? 0 : 1
128-
windows.widgetWindow.alphaValue = noFocus ? 0 : 1
131+
windows.widgetWindow.alphaValue = if noFocus {
132+
0
133+
} else if previousAppIsXcode {
134+
1
135+
} else {
136+
0
137+
}
129138
windows.toastWindow.alphaValue = noFocus ? 0 : 1
130139
if isChatPanelDetached {
131140
windows.chatPanelWindow.isWindowHidden = !hasChat

0 commit comments

Comments
 (0)