File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,7 @@ import SwiftUI
104104 . first ( where: { $0. isKind ( of: containerClass) } )
105105 else { return nil }
106106
107- guard let titlebarClass = NSClassFromString ( " NSTitlebarView " ) else { return nil }
108- guard let titlebar = containerView. subviews. first ( where: { $0. isKind ( of: titlebarClass) } )
109- else { return nil }
110-
111- _titlebarView = titlebar
112-
107+ _titlebarView = containerView
113108 return _titlebarView
114109 }
115110
Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ struct ContentView: View {
6868 . background {
6969 Color . black. ignoresSafeArea ( )
7070 }
71+ . onAppear {
72+ resetMouseIdleTimer ( )
73+ }
7174 . onContinuousHover { phase in
7275 switch phase {
7376 case . active:
@@ -90,11 +93,15 @@ struct ContentView: View {
9093 }
9194 }
9295 . onChange ( of: WindowController . shared. isMouseInTitleBar) { _, isInTitleBar in
93- // When mouse enters title bar, show controls and reset idle timer
9496 if isInTitleBar {
97+ // When mouse enters title bar, show controls and reset idle timer
9598 showPlayerControls ( )
9699 WindowController . shared. showTitlebar ( )
97100 resetMouseIdleTimer ( )
101+ } else if !mouseInsideWindow && !WindowController. shared. isMouseInPlayerControls {
102+ // When mouse leaves title bar and is not in content area or controls, hide UI
103+ hidePlayerControls ( )
104+ WindowController . shared. hideTitlebar ( )
98105 }
99106 }
100107 }
You can’t perform that action at this time.
0 commit comments