From f7ad9b9b29aee2d830477fe29cea2a9b4abc0acb Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 2 Nov 2025 21:21:16 +0200 Subject: [PATCH] freeciv-3.2: Update to 3.2.1 Signed-off-by: Marko Lindqvist --- ...-Qt-Work-around-Qt-6.9-theming-issue.patch | 92 +++++++++++++++++++ .../{freeciv_3.2.0.bb => freeciv_3.2.1.bb} | 5 +- 2 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 recipes-games/freeciv/freeciv/0019-Qt-Work-around-Qt-6.9-theming-issue.patch rename recipes-games/freeciv/{freeciv_3.2.0.bb => freeciv_3.2.1.bb} (50%) diff --git a/recipes-games/freeciv/freeciv/0019-Qt-Work-around-Qt-6.9-theming-issue.patch b/recipes-games/freeciv/freeciv/0019-Qt-Work-around-Qt-6.9-theming-issue.patch new file mode 100644 index 0000000..06f314e --- /dev/null +++ b/recipes-games/freeciv/freeciv/0019-Qt-Work-around-Qt-6.9-theming-issue.patch @@ -0,0 +1,92 @@ +Upstream-Status: Backport + +From 48875b712fe1b5009a80a1fb4280fe1904677012 Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +Date: Sun, 2 Nov 2025 09:14:58 +0200 +Subject: [PATCH 19/20] Qt: Work around Qt-6.9 theming issue + +See RM #1697 + +Signed-off-by: Marko Lindqvist +--- + client/gui-qt/citydlg.cpp | 2 ++ + client/gui-qt/gui_main.h | 2 ++ + client/gui-qt/themes.cpp | 17 ++++++++++++++--- + 3 files changed, 18 insertions(+), 3 deletions(-) + +diff --git a/client/gui-qt/citydlg.cpp b/client/gui-qt/citydlg.cpp +index 1d569b8a8d..b2c6d5a6f7 100644 +--- a/client/gui-qt/citydlg.cpp ++++ b/client/gui-qt/citydlg.cpp +@@ -2044,6 +2044,8 @@ city_dialog::city_dialog(QWidget *parent): qfc_dialog(parent) + installEventFilter(this); + + ::city_dlg_created = true; ++ ++ set_theme_style(); + } + + /************************************************************************//** +diff --git a/client/gui-qt/gui_main.h b/client/gui-qt/gui_main.h +index d825cba768..94d3a0d20f 100644 +--- a/client/gui-qt/gui_main.h ++++ b/client/gui-qt/gui_main.h +@@ -23,4 +23,6 @@ QApplication *current_app(); + #define CAPTURE_DEFAULT_THIS [=] + #endif // FREECIV_HAVE_CXX20_CAPTURE_THIS + ++void set_theme_style(); ++ + #endif // FC__GUI_MAIN_H +diff --git a/client/gui-qt/themes.cpp b/client/gui-qt/themes.cpp +index 79092d65b2..6e4e5bdf3c 100644 +--- a/client/gui-qt/themes.cpp ++++ b/client/gui-qt/themes.cpp +@@ -38,6 +38,8 @@ extern QString current_theme; + static QString def_app_style; + static QString stylestring; + ++static QStyle *current_style = nullptr; ++ + /*************************************************************************//** + Loads a qt theme directory/theme_name + *****************************************************************************/ +@@ -76,16 +78,17 @@ void qtg_gui_load_theme(const char *directory, const char *theme_name) + stylestring.replace(lnb, fake_dir + "/" + theme_name + "/"); + + if (QString(theme_name) == QString("System")) { +- QApplication::setStyle(QStyleFactory::create(def_app_style)); ++ current_style = QStyleFactory::create(def_app_style); + } else { + QStyle *fstyle = QStyleFactory::create("Fusion"); + + if (fstyle != nullptr) { +- QApplication::setStyle(fstyle); ++ current_style = fstyle; + } else { +- QApplication::setStyle(QStyleFactory::create(def_app_style)); ++ current_style = QStyleFactory::create(def_app_style); + } + } ++ QApplication::setStyle(current_style); + + current_theme = theme_name; + QPixmapCache::clear(); +@@ -98,6 +101,14 @@ void qtg_gui_load_theme(const char *directory, const char *theme_name) + QApplication::setPalette(pal); + } + ++/*************************************************************************//** ++ Set theme style again, to work around Qt theming bug. ++*****************************************************************************/ ++void set_theme_style() ++{ ++ QApplication::setStyle(current_style); ++} ++ + /*************************************************************************//** + Clears a theme (sets default system theme) + *****************************************************************************/ +-- +2.51.0 + diff --git a/recipes-games/freeciv/freeciv_3.2.0.bb b/recipes-games/freeciv/freeciv_3.2.1.bb similarity index 50% rename from recipes-games/freeciv/freeciv_3.2.0.bb rename to recipes-games/freeciv/freeciv_3.2.1.bb index cc85af4..1cd9d35 100644 --- a/recipes-games/freeciv/freeciv_3.2.0.bb +++ b/recipes-games/freeciv/freeciv_3.2.1.bb @@ -1,13 +1,12 @@ require freeciv-qt6.inc -DEFAULT_PREFERENCE = "-1" - DEPENDS += "lua" SRC_URI += "\ ${SOURCEFORGE_MIRROR}/freeciv/freeciv-${PV}.tar.xz \ file://allow-root-S3_2.patch \ +file://0019-Qt-Work-around-Qt-6.9-theming-issue.patch \ " -SRC_URI[sha256sum] = "828e831b672a46b316f6fdb23e670230b2ec9c05b6fe8c66fc9f7e1c0679fcde" +SRC_URI[sha256sum] = "3fc01ef55bfc9b9c2d71432d22a9fc5ab5892285d15d3dc888ec4bb288d21caa"