fix(nav): preserve HTPC escape behavior

Use Flutter's supported desktop application-exit API so the second root Back press closes Plezy on Windows. Preserve fullscreen when video player navigation is enabled while keeping fullscreen-first Escape behavior for normal desktop use.

close #1582
This commit is contained in:
edde746
2026-07-16 20:43:10 +02:00
parent a244d249bd
commit 6df8aba097
5 changed files with 94 additions and 10 deletions
+7 -4
View File
@@ -591,10 +591,13 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
isChromePresented: () =>
_isPlayerInitialized && player != null && _hasFirstFrame.value && _chromeController.controlsPresented,
exitFullscreenIfActive: FullscreenStateManager().exitFullscreenIfActive,
// macOS fullscreen belongs to the app window, not the player route.
// Escape stages through chrome/player Back and the root Home screen
// owns leaving native fullscreen.
physicalEscapeExitsFullscreen: !Platform.isMacOS,
// macOS fullscreen belongs to the app window, while HTPC-style player
// navigation treats physical Escape as semantic Back. In both cases the
// player must leave native fullscreen alone.
physicalEscapeExitsFullscreen: () => shouldPhysicalEscapeExitFullscreen(
isMacOS: Platform.isMacOS,
videoPlayerNavigationEnabled: _videoPlayerNavigationEnabled,
),
exitPlayer: () => unawaited(_handleBackButton()),
navigateHome: _handleHomeButton,
isActive: () => mounted,