diff --git a/include/FramelessHelper/Core/utils.h b/include/FramelessHelper/Core/utils.h index 30aba44..d93f158 100644 --- a/include/FramelessHelper/Core/utils.h +++ b/include/FramelessHelper/Core/utils.h @@ -57,7 +57,7 @@ FRAMELESSHELPER_CORE_API void moveWindowToDesktopCenter( [[nodiscard]] FRAMELESSHELPER_CORE_API bool isWin8OrGreater(); [[nodiscard]] FRAMELESSHELPER_CORE_API bool isWin8Point1OrGreater(); [[nodiscard]] FRAMELESSHELPER_CORE_API bool isWin10OrGreater(); -[[nodiscard]] FRAMELESSHELPER_CORE_API bool isWin101809OrGreater(); +[[nodiscard]] FRAMELESSHELPER_CORE_API bool isWin101607OrGreater(); [[nodiscard]] FRAMELESSHELPER_CORE_API bool isWin11OrGreater(); [[nodiscard]] FRAMELESSHELPER_CORE_API bool isDwmCompositionEnabled(); FRAMELESSHELPER_CORE_API void triggerFrameChange(const WId windowId); diff --git a/src/core/framelesshelper_win.cpp b/src/core/framelesshelper_win.cpp index 90c4406..b16efbe 100644 --- a/src/core/framelesshelper_win.cpp +++ b/src/core/framelesshelper_win.cpp @@ -677,7 +677,7 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me } } const bool themeSettingChanged = [uMsg, wParam, lParam]() -> bool { - if (Utils::isWin10OrGreater()) { + if (Utils::isWin101607OrGreater()) { if (uMsg == WM_SETTINGCHANGE) { if ((wParam == 0) && (QString::fromWCharArray(reinterpret_cast(lParam)) .compare(QU8Str(kThemeSettingChangeEventName), Qt::CaseInsensitive) == 0)) { diff --git a/src/core/utils_win.cpp b/src/core/utils_win.cpp index 02013f0..c7f8f28 100644 --- a/src/core/utils_win.cpp +++ b/src/core/utils_win.cpp @@ -455,8 +455,8 @@ QColor Utils::getDwmColorizationColor() bool Utils::shouldAppsUseDarkMode() { - // The global dark mode was first introduced in Windows 10 1809. - if (!isWin101809OrGreater()) { + // The global dark mode was first introduced in Windows 10 1607. + if (!isWin101607OrGreater()) { return false; } const auto resultFromRegistry = []() -> bool { @@ -684,14 +684,12 @@ void Utils::syncWmPaintWithDwm() } } -bool Utils::isWin101809OrGreater() +bool Utils::isWin101607OrGreater() { -#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)) - static const bool result = (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10_1809); -#elif (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) - static const bool result = (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 17763)); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) + static const bool result = (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 14393)); #else - static const bool result = isWindowsVersionOrGreater(10, 0, 17763); + static const bool result = isWindowsVersionOrGreater(10, 0, 14393); #endif return result; } @@ -880,8 +878,8 @@ void Utils::updateWindowFrameBorderColor(const WId windowId, const bool dark) if (!windowId) { return; } - // There's no global dark theme before Win10 1809. - if (!isWin101809OrGreater()) { + // There's no global dark theme before Win10 1607. + if (!isWin101607OrGreater()) { return; } static const auto pDwmSetWindowAttribute = @@ -1188,7 +1186,7 @@ SystemTheme Utils::getSystemTheme() if (isHighContrastModeEnabled()) { return SystemTheme::HighContrast; } - if (isWin101809OrGreater() && shouldAppsUseDarkMode()) { + if (isWin101607OrGreater() && shouldAppsUseDarkMode()) { return SystemTheme::Dark; } return SystemTheme::Light;