File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1372,14 +1372,23 @@ public final class PUIPlayerView: NSView {
1372
1372
return window. styleMask. contains ( . fullScreen)
1373
1373
}
1374
1374
1375
+ private var isTransitioningFromFullScreenPlayback = false
1376
+
1375
1377
@objc private func windowWillEnterFullScreen( ) {
1378
+ guard window is PUIPlayerWindow else { return }
1379
+
1376
1380
appearanceDelegate? . presentDetachedStatus ( . fullScreen. snapshot ( using: snapshotClosure) , for: self )
1377
1381
1378
1382
fullScreenButton. isHidden = true
1379
1383
updateTopTrailingMenuPosition ( )
1380
1384
}
1381
1385
1382
1386
@objc private func windowWillExitFullScreen( ) {
1387
+ guard window is PUIPlayerWindow else { return }
1388
+
1389
+ /// Set this because it's not safe to check for our window's class in `windowDidExitFullScreen`.
1390
+ isTransitioningFromFullScreenPlayback = true
1391
+
1383
1392
/// The transition looks nicer if there's no background color, otherwise the player looks like it attaches
1384
1393
/// to the whole shelf area with black bars depending on the aspect ratio.
1385
1394
backgroundColor = . clear
@@ -1392,6 +1401,10 @@ public final class PUIPlayerView: NSView {
1392
1401
}
1393
1402
1394
1403
@objc private func windowDidExitFullScreen( ) {
1404
+ guard isTransitioningFromFullScreenPlayback else { return }
1405
+
1406
+ isTransitioningFromFullScreenPlayback = false
1407
+
1395
1408
/// Restore solid black background after finishing exit full screen transition.
1396
1409
backgroundColor = . black
1397
1410
You can’t perform that action at this time.
0 commit comments