From e97ef5a61717c9319a41c7bc70ea9e4410af1b4d Mon Sep 17 00:00:00 2001 From: BruebachL <44814898+BruebachL@users.noreply.github.com> Date: Mon, 21 Sep 2026 21:45:11 +0200 Subject: [PATCH] [Style] Do not offer broken windows11 (#7341) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lukas BrĂ¼bach --- cockatrice/src/interface/theme_manager.cpp | 12 +++++++++--- .../settings_page/appearance_settings_page.cpp | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/interface/theme_manager.cpp b/cockatrice/src/interface/theme_manager.cpp index 3b03861b9..d93dfcf62 100644 --- a/cockatrice/src/interface/theme_manager.cpp +++ b/cockatrice/src/interface/theme_manager.cpp @@ -95,9 +95,11 @@ struct PaletteColorInfo static QString usableDefaultStyle(const QString &style) { - // The Windows 11 native style is broken: when the OS default - // ("System" theme selection) would use it, fall back to the Vista style. - // Explicitly choosing "windows11" in a theme is still honored. + // The Windows 11 native style is broken: dragging cards across zones can + // shrink the board to a tiny grey window that is unfixable without + // rejoining. It is never usable, so guard against it no matter how it was + // requested (OS default or an explicit "windows11" theme choice) and fall + // back to the Vista style. return style.compare("windows11", Qt::CaseInsensitive) == 0 ? QStringLiteral("windowsvista") : style; } @@ -410,6 +412,10 @@ void ThemeManager::applyStyleAndPalette(const QString &themeName, } } + // The Windows 11 style is broken even when selected explicitly in a theme, + // so sanitize the resolved name here rather than trusting the theme config. + styleName = usableDefaultStyle(styleName); + QStyle *style = QStyleFactory::create(styleName); if (!style) { style = QStyleFactory::create(usableDefaultStyle(defaultStyleName)); diff --git a/cockatrice/src/interface/widgets/settings_page/appearance_settings_page.cpp b/cockatrice/src/interface/widgets/settings_page/appearance_settings_page.cpp index 005d77dc9..415eef6b9 100644 --- a/cockatrice/src/interface/widgets/settings_page/appearance_settings_page.cpp +++ b/cockatrice/src/interface/widgets/settings_page/appearance_settings_page.cpp @@ -62,6 +62,12 @@ AppearanceSettingsPage::AppearanceSettingsPage() // Qt widget style; "System" lets the application decide styleCombo.addItem(tr("System"), QStringLiteral("System")); for (const QString &key : QStyleFactory::keys()) { + // The Windows 11 native style is broken (board rendering glitches when + // moving cards), so never offer it; it is already sanitized at apply + // time in ThemeManager. + if (key.compare("windows11", Qt::CaseInsensitive) == 0) { + continue; + } styleCombo.addItem(key, key); }