From 28e069c9992f05cfd0beb2f4163f35ceca2ad1a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Fri, 15 Nov 2024 03:34:15 +0800 Subject: [PATCH] fix --- .github/scripts/build_lunahook.py | 1 - .github/scripts/build_lunatranslator.py | 1 - cpp/winsharedutils/webview2_extra.cpp | 8 ++++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/scripts/build_lunahook.py b/.github/scripts/build_lunahook.py index a664603f..5b836b20 100644 --- a/.github/scripts/build_lunahook.py +++ b/.github/scripts/build_lunahook.py @@ -76,7 +76,6 @@ def build_langx_xp(lang, core): cmake -DBUILD_PLUGIN=OFF -DWINXP=ON -DLANGUAGE={lang} {flags} ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_{lang}_xp cmake --build ../build/x86_{lang}_xp --config Release --target ALL_BUILD -j 14 -call dobuildxp.bat """ ) os.system(f"cmd /c do.bat") diff --git a/.github/scripts/build_lunatranslator.py b/.github/scripts/build_lunatranslator.py index d46a9497..51e6877e 100644 --- a/.github/scripts/build_lunatranslator.py +++ b/.github/scripts/build_lunatranslator.py @@ -223,7 +223,6 @@ def buildPlugins(arch): cmake -DWINXP=ON ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_xp cmake --build ../build/x86_xp --config Release --target ALL_BUILD -j 14 -call dobuildxp.bat """ ) os.system(f"cmd /c do.bat") diff --git a/cpp/winsharedutils/webview2_extra.cpp b/cpp/winsharedutils/webview2_extra.cpp index 960c8e6b..2a353e86 100644 --- a/cpp/winsharedutils/webview2_extra.cpp +++ b/cpp/winsharedutils/webview2_extra.cpp @@ -27,9 +27,9 @@ DECLARE_API void set_transparent_background(void *m_host) #endif } +#ifndef WINXP DECLARE_API void put_PreferredColorScheme(void *m_host, COREWEBVIEW2_PREFERRED_COLOR_SCHEME scheme) { -#ifndef WINXP wil::com_ptr m_controller(reinterpret_cast(m_host)); wil::com_ptr coreWebView2; [&]() @@ -44,8 +44,12 @@ DECLARE_API void put_PreferredColorScheme(void *m_host, COREWEBVIEW2_PREFERRED_C } return S_OK; }(); -#endif } +#else +DECLARE_API void put_PreferredColorScheme(void *m_host, int scheme) +{ +} +#endif DECLARE_API void *add_ZoomFactorChanged(void *m_host, void (*signal)(double)) { #ifndef WINXP