From: Claudio Cambra Date: Tue, 5 Nov 2024 08:02:32 +0000 (+0900) Subject: Use old palette change detection method on Windows 10 and under X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~5^2~40^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d2d91bb10581e04d121daa9aab47071fa1e8215a;p=nextcloud-desktop.git Use old palette change detection method on Windows 10 and under Signed-off-by: Claudio Cambra --- diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 2f9944b92..e69c34922 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -969,8 +969,15 @@ void Theme::connectToPaletteSignal() { if (!_paletteSignalsConnected) { if (const auto ptr = qobject_cast(QGuiApplication::instance())) { - connect(ptr, &QGuiApplication::paletteChanged, this, &Theme::systemPaletteChanged); - connect(ptr->styleHints(), &QStyleHints::colorSchemeChanged, this, &Theme::darkModeChanged); +#ifdef Q_OS_WIN + // Windows 10 does not have proper dark mode support via Qt 6 so hack detection + if (!IsWindows11OrGreater()) { + connect(ptr, &QGuiApplication::paletteChanged, this, &Theme::darkModeChanged); + } else +#endif + { + connect(ptr->styleHints(), &QStyleHints::colorSchemeChanged, this, &Theme::darkModeChanged); + } _paletteSignalsConnected = true; } }