Replace macOS inline player sheet with full-window overlay

When "Play in a separate window" is disabled, the expanded player was a
native sheet attached to the main window. AppKit refuses fullscreen with
an attached sheet, so pressing F swapped the sheet for an in-window
overlay before fullscreening — a visible two-step transition.

Present the inline player as the full-window overlay from the start, so
fullscreen is just the window's native toggle. This removes the whole
sheet-swap machinery (toggleSheetFullScreen with its detach timing,
SheetWindowResizer, sheet sizing helpers).

- beginInlineOverlay/endInlineOverlay hide/restore the main window
  toolbar and mirror the window's fullscreen state into the renamed
  isMacInlinePlayerFullScreen flag via NSWindow notifications, so exits
  through Esc/green button/Mission Control stay in sync
- Collapsing exits fullscreen only if it was entered for the video
- Esc in the windowed overlay collapses to the mini bar via a new
  onCollapse callback (replacing the sheet's default Esc-dismiss)
- ContentView registers its hosting window (MainContentWindowReader) so
  the overlay targets the right window even when the setting is toggled
  while the Settings window has focus
This commit is contained in:
Arkadiusz Fal
2026-07-03 21:57:55 +02:00
parent 944be5a722
commit ecb6a9dd7a
5 changed files with 167 additions and 290 deletions

View File

@@ -1575,12 +1575,19 @@ extension ExpandedPlayerSheet {
// config first so a pinned window can enter fullscreen)
ExpandedPlayerWindowManager.shared.toggleFullScreen()
},
// The coordinator flag covers overlay fullscreen (where the
// The coordinator flag covers the inline overlay (where the
// main window is the fullscreen one) and, being @Observable,
// refreshes the button icon on toggle; the keyWindow check
// covers the separate-window presentation.
isFullscreen: navigationCoordinator?.isMacPlayerFullScreenOverlay == true
isFullscreen: navigationCoordinator?.isMacInlinePlayerFullScreen == true
|| NSApp.keyWindow?.styleMask.contains(.fullScreen) == true,
// Esc collapses the inline overlay to the mini bar; in
// separate-window mode Esc keeps its default handling.
onCollapse: appEnvironment?.settingsManager.macPlayerSeparateWindow == true
? nil
: { [weak navigationCoordinator] in
navigationCoordinator?.isPlayerExpanded = false
},
onClose: { [self] in
closeVideo()
},