@@ -11,7 +11,6 @@ final class VideoWindowController {
1111
1212 private var window : NSWindow ?
1313 private var hostingView : NSHostingView < AnyView > ?
14- private let logger = DiagnosticsLogger . player
1514
1615 /// Reference to PlayerService to sync showVideo state
1716 private weak var playerService : PlayerService ?
@@ -35,8 +34,6 @@ final class VideoWindowController {
3534 playerService: PlayerService ,
3635 webKitManager: WebKitManager
3736 ) {
38- self . logger. debug ( " VideoWindowController.show() called " )
39-
4037 // Store reference to sync state on close
4138 self . playerService = playerService
4239
@@ -45,16 +42,13 @@ final class VideoWindowController {
4542
4643 if let existingWindow = self . window {
4744 // Window exists - just bring it to front
48- self . logger. debug ( " Window already exists, bringing to front " )
4945 self . isClosing = false // Reset in case of interrupted close
5046 existingWindow. makeKeyAndOrderFront ( nil )
5147 // Ensure video mode is active
5248 SingletonPlayerWebView . shared. updateDisplayMode ( . video)
5349 return
5450 }
5551
56- self . logger. info ( " Creating new video window " )
57-
5852 let contentView = VideoPlayerWindow ( )
5953 . environment ( playerService)
6054 . environment ( webKitManager)
@@ -101,27 +95,16 @@ final class VideoWindowController {
10195 )
10296
10397 // Update WebView display mode for video
104- self . logger. info ( " Calling updateDisplayMode(.video) " )
10598 SingletonPlayerWebView . shared. updateDisplayMode ( . video)
10699 }
107100
108101 /// Closes the video window programmatically (called when showVideo becomes false).
109102 func close( ) {
110- self . logger. debug ( " VideoWindowController.close() called " )
111-
112103 // Prevent re-entrant calls
113- guard !self . isClosing else {
114- self . logger. debug ( " Already closing, skipping " )
115- return
116- }
117-
118- guard let window = self . window else {
119- self . logger. debug ( " No window to close " )
120- return
121- }
104+ guard !self . isClosing else { return }
105+ guard let window = self . window else { return }
122106
123107 self . isClosing = true
124- self . logger. info ( " Closing video window " )
125108
126109 // Remove observer before closing to prevent windowWillClose from firing
127110 NotificationCenter . default. removeObserver ( self , name: NSWindow . willCloseNotification, object: window)
@@ -139,13 +122,8 @@ final class VideoWindowController {
139122
140123 /// Called when window is closed via the red X button.
141124 @objc private func windowWillClose( _ notification: Notification ) {
142- self . logger. info ( " windowWillClose notification received " )
143-
144125 // Prevent re-entrant calls
145- guard !self . isClosing else {
146- self . logger. debug ( " Already closing, skipping windowWillClose " )
147- return
148- }
126+ guard !self . isClosing else { return }
149127 self . isClosing = true
150128
151129 // Update corner based on final position
@@ -160,15 +138,12 @@ final class VideoWindowController {
160138 // Sync PlayerService state - this handles close via red button
161139 // This will trigger MainWindow.onChange which calls close(), but isClosing prevents re-entry
162140 if self . playerService? . showVideo == true {
163- self . logger. debug ( " Syncing playerService.showVideo to false " )
164141 self . playerService? . showVideo = false
165142 }
166143 }
167144
168145 /// Shared cleanup logic for both close paths.
169146 private func performCleanup( ) {
170- self . logger. debug ( " performCleanup called " )
171-
172147 // Clear grace period
173148 self . playerService? . videoWindowDidClose ( )
174149
0 commit comments