File tree Expand file tree Collapse file tree
Core/Sources/SuggestionWidget Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments