Skip to content

Commit b167b4f

Browse files
authored
Merge pull request #714 from insidegui/rambo/fix-fullscreen-bug
Fixed full screen status shown when main window enters full screen
2 parents 09d5da5 + 9610d14 commit b167b4f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

PlayerUI/Views/PUIPlayerView.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,14 +1372,23 @@ public final class PUIPlayerView: NSView {
13721372
return window.styleMask.contains(.fullScreen)
13731373
}
13741374

1375+
private var isTransitioningFromFullScreenPlayback = false
1376+
13751377
@objc private func windowWillEnterFullScreen() {
1378+
guard window is PUIPlayerWindow else { return }
1379+
13761380
appearanceDelegate?.presentDetachedStatus(.fullScreen.snapshot(using: snapshotClosure), for: self)
13771381

13781382
fullScreenButton.isHidden = true
13791383
updateTopTrailingMenuPosition()
13801384
}
13811385

13821386
@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+
13831392
/// The transition looks nicer if there's no background color, otherwise the player looks like it attaches
13841393
/// to the whole shelf area with black bars depending on the aspect ratio.
13851394
backgroundColor = .clear
@@ -1392,6 +1401,10 @@ public final class PUIPlayerView: NSView {
13921401
}
13931402

13941403
@objc private func windowDidExitFullScreen() {
1404+
guard isTransitioningFromFullScreenPlayback else { return }
1405+
1406+
isTransitioningFromFullScreenPlayback = false
1407+
13951408
/// Restore solid black background after finishing exit full screen transition.
13961409
backgroundColor = .black
13971410

0 commit comments

Comments
 (0)