From d76c636795e417758964153be93701c896dd5ac0 Mon Sep 17 00:00:00 2001 From: pepaskopec-blip Date: Wed, 16 Sep 2026 12:30:44 +0200 Subject: [PATCH] Fix Linux CI build on Ubuntu 22.04 GTK 4.6. Provide G_APPLICATION_DEFAULT_FLAGS and css provider fallbacks for older GLib/GTK. Co-authored-by: Cursor --- maturita.h | 5 +++++ theme.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/maturita.h b/maturita.h index 0ff3136..604bc51 100644 --- a/maturita.h +++ b/maturita.h @@ -7,6 +7,11 @@ #include #include +/* GLib on Ubuntu 22.04 predates G_APPLICATION_DEFAULT_FLAGS. */ +#ifndef G_APPLICATION_DEFAULT_FLAGS +#define G_APPLICATION_DEFAULT_FLAGS G_APPLICATION_FLAGS_NONE +#endif + #define NUM_UNITS 10 #define NUM_UNLOCKED 3 /* first NUM_UNLOCKED units (index 0..2) are open */ #define MAX_UNIT_EX 20 /* largest exercise count any unit may have */ diff --git a/theme.c b/theme.c index 57f36c7..db9e3d3 100644 --- a/theme.c +++ b/theme.c @@ -394,7 +394,12 @@ void apply_theme(void) { GTK_STYLE_PROVIDER_PRIORITY_USER); } + #if GTK_CHECK_VERSION(4, 12, 0) gtk_css_provider_load_from_string(theme_provider, css); +#else + /* GTK 4.6 (Ubuntu 22.04) — load_from_string arrived in 4.12. */ + gtk_css_provider_load_from_data(theme_provider, css, -1); +#endif g_free(css); refresh_welcome_heading();