fix: apply display matching on fullscreen enter

This commit is contained in:
edde746
2026-04-17 15:03:50 +02:00
parent 91057c12a4
commit 47837edb01
2 changed files with 15 additions and 5 deletions
+11 -4
View File
@@ -929,11 +929,18 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> 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();
}
}
+4 -1
View File
@@ -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;