diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index 56f0db7c9e7..1379018793b 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -604,16 +604,16 @@ void QWindowsTheme::handleSettingsChanged() const auto newColorScheme = effectiveColorScheme(); const bool colorSchemeChanged = newColorScheme != oldColorScheme; s_colorScheme = newColorScheme; + if (!colorSchemeChanged) + return; auto integration = QWindowsIntegration::instance(); integration->updateApplicationBadge(); if (integration->darkModeHandling().testFlag(QWindowsApplication::DarkModeStyle)) { QWindowsTheme::instance()->refresh(); QWindowSystemInterface::handleThemeChange(); } - if (colorSchemeChanged) { - for (QWindowsWindow *w : std::as_const(QWindowsContext::instance()->windows())) - w->setDarkBorder(s_colorScheme == Qt::ColorScheme::Dark); - } + for (QWindowsWindow *w : std::as_const(QWindowsContext::instance()->windows())) + w->setDarkBorder(s_colorScheme == Qt::ColorScheme::Dark); } void QWindowsTheme::clearPalettes()