diff --git a/lib/screens/video_player_screen.dart b/lib/screens/video_player_screen.dart index 7dd8ea9c..132b761b 100644 --- a/lib/screens/video_player_screen.dart +++ b/lib/screens/video_player_screen.dart @@ -929,11 +929,18 @@ class VideoPlayerScreenState extends State with WidgetsBindin } } - /// Called when fullscreen state changes — restore display mode if exiting fullscreen. + /// Called when fullscreen state changes — apply or restore Windows display + /// matching. On Windows the player opens windowed by default, so the initial + /// attempt during `playbackRestart` is skipped by DisplayModeService's + /// fullscreen gate. Catching the enter-fullscreen transition here lets the + /// switch happen at the natural moment the user starts watching. void _onFullscreenChanged() { - if (!FullscreenStateManager().isFullscreen && - _displayModeService != null && - _displayModeService!.anyChangeApplied) { + if (_displayModeService == null) return; + if (FullscreenStateManager().isFullscreen) { + if (_hasFirstFrame.value && !_displayModeService!.anyChangeApplied) { + _applyWindowsDisplayMatching(); + } + } else if (_displayModeService!.anyChangeApplied) { _restoreWindowsDisplayMode(); } } diff --git a/lib/services/display_mode_service.dart b/lib/services/display_mode_service.dart index 8d1ef03d..00cfba85 100644 --- a/lib/services/display_mode_service.dart +++ b/lib/services/display_mode_service.dart @@ -29,7 +29,10 @@ class DisplayModeService { required double? sigPeak, }) async { if (!Platform.isWindows) return Duration.zero; - if (!_fullscreen.isFullscreen) return Duration.zero; + if (!_fullscreen.isFullscreen) { + appLogger.d('Display matching skipped: not in fullscreen'); + return Duration.zero; + } bool anyChange = false;