mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 14:22:02 +00:00
Add native fullscreen for macOS sheet-mode player via in-window overlay
The fullscreen button did nothing in sheet mode: AppKit ignores toggleFullScreen on a window attached as a sheet, and the old fallback targeted the key window — the sheet itself. Two other strategies were ruled out first: fullscreening the sheet's parent is silently refused while any sheet is attached, and resizing the sheet's backing window to screen size NaN-asserts inside AppKit's sheet positioning even without animation. Working approach: swap the sheet for a plain overlay in the main window and native-fullscreen the now sheet-free main window. - isMacPlayerFullScreenOverlay on NavigationCoordinator dismisses the sheet (presentation binding excludes it; the setter ignores the dismissal write-back) and mounts ExpandedPlayerSheet as a black-backed overlay in ContentView - ExpandedPlayerWindowManager fullscreens the parent after the sheet detaches, verifies AppKit accepted it (rolls back if refused), hides the window toolbar (NSWindow keeps it as a strip above the overlay otherwise) and restores it on exit - a didExitFullScreen observer restores the sheet on any exit path (button, Esc, green button, Window menu); closing the player while fullscreen exits the main window's fullscreen too - scheduleSharedViewAdoptionRetry on entry re-homes the shared render view once the dismissing sheet's window loses visibility — its steal is declined mid-dismissal and nothing else retried, leaving the overlay black until the next video load
This commit is contained in:
@@ -115,6 +115,11 @@ final class NavigationCoordinator {
|
||||
/// Whether the player is currently expanding (for animation coordination with mini player).
|
||||
var isPlayerExpanding = false
|
||||
|
||||
/// macOS only: true while the inline player runs in fullscreen overlay
|
||||
/// mode — sheet dismissed, player shown as an overlay in the main window,
|
||||
/// main window native-fullscreen. Set/cleared by ExpandedPlayerWindowManager.
|
||||
var isMacPlayerFullScreenOverlay = false
|
||||
|
||||
/// Whether the player is currently collapsing (for animation coordination with mini player).
|
||||
var isPlayerCollapsing = false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user