fix(windows): fixed black screen while navigating between videos in full screen

This commit is contained in:
Cameron
2026-04-26 16:59:50 +01:00
committed by GitHub
parent 425da3ab7d
commit 6371d7a36e
5 changed files with 45 additions and 4 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.16)
project(runner LANGUAGES CXX)
# Define the application target. To change its name, change BINARY_NAME in the
@@ -26,6 +26,9 @@ add_executable(${BINARY_NAME} WIN32
# that need different build settings.
apply_standard_settings(${BINARY_NAME})
# Setup precompiled header
target_precompile_headers(${BINARY_NAME} PRIVATE "pch.h")
# Add preprocessor definitions for the build version.
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
+4
View File
@@ -438,6 +438,10 @@ void MpvPlayerPlugin::HandleMethodCall(
HWND hwnd = GetWindow();
bool success = display_mode_manager_.RestoreOriginalHDRState(hwnd);
result->Success(flutter::EncodableValue(success));
} else if (method == "isModeChanged") {
result->Success(flutter::EncodableValue(display_mode_manager_.IsModeChanged()));
} else if (method == "isHDRChanged") {
result->Success(flutter::EncodableValue(display_mode_manager_.IsHDRChanged()));
} else {
result->NotImplemented();
}
+19
View File
@@ -0,0 +1,19 @@
#ifndef PCH_H
#define PCH_H
#include <Windows.h>
#include <dwmapi.h>
#include <optional>
#include <memory>
#include <io.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <cmath>
#include <algorithm>
#include <map>
#endif