Skip to content

Commit 82307fe

Browse files
committed
Fix window level
1 parent 58727f6 commit 82307fe

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Core/Sources/SuggestionWidget/PromptToCodePanelGroupView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ struct PromptToCodeTabBar: View {
3737

3838
var body: some View {
3939
HStack(spacing: 0) {
40-
Divider()
4140
Tabs(store: store)
4241
}
4342
.background {

Core/Sources/SuggestionWidget/WidgetWindowsController.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ extension WidgetWindowsController {
396396
let previousActiveApplication = xcodeInspector.previousActiveApplication
397397
await MainActor.run {
398398
let state = store.withState { $0 }
399-
let isChatPanelDetached = state.chatPanelState.isDetached
400399

401400
if let activeApp, activeApp.isXcode {
402401
let application = activeApp.appElement
@@ -749,6 +748,7 @@ public final class WidgetWindows {
749748
it.isOpaque = false
750749
it.backgroundColor = .clear
751750
it.level = widgetLevel(2)
751+
it.hoveringLevel = widgetLevel(2)
752752
it.hasShadow = true
753753
it.contentView = NSHostingView(
754754
rootView: SharedPanelView(
@@ -811,6 +811,7 @@ public final class WidgetWindows {
811811
self?.store.send(.chatPanel(.hideButtonClicked))
812812
}
813813
)
814+
it.hoveringLevel = widgetLevel(1)
814815
it.delegate = controller
815816
return it
816817
}()
@@ -874,6 +875,8 @@ class WidgetWindow: CanBecomeKeyWindow {
874875
case normal(fullscreen: Bool)
875876
case switchingSpace
876877
}
878+
879+
var hoveringLevel: NSWindow.Level = widgetLevel(0)
877880

878881
var defaultCollectionBehavior: NSWindow.CollectionBehavior {
879882
[.fullScreenAuxiliary, .transient]
@@ -908,7 +911,7 @@ class WidgetWindow: CanBecomeKeyWindow {
908911

909912
func setFloatOnTop(_ isFloatOnTop: Bool) {
910913
let targetLevel: NSWindow.Level = isFloatOnTop
911-
? .init(NSWindow.Level.floating.rawValue + 1)
914+
? hoveringLevel
912915
: .normal
913916

914917
if targetLevel != level {

0 commit comments

Comments
 (0)