Fixed GTK3 theme switching on Win32 so fallback window CSS is synchronized immediately when switching back to the system theme (theme_name == NULL) by calling fe_apply_windows_theme(dark) in that path before provider cleanup.

Fixed GTK3 theme activation on Win32 so fallback window CSS is disabled immediately after loading an imported GTK3 theme, preventing mixed styling (like unthemed buttons/chat areas) during runtime theme changes
This commit is contained in:
2026-02-26 08:58:38 -07:00
parent a93bed2c41
commit 9ef607f44a

View File

@@ -756,6 +756,12 @@ fe_apply_gtk3_theme_with_reload (const char *theme_name, gboolean force_reload,
if (!theme_name || !*theme_name)
{
#ifdef G_OS_WIN32
/* Keep the Win32 fallback provider in sync when returning to the
* system theme from Preferences > Themes. */
fe_apply_windows_theme (dark);
#endif
if (gtk3_theme_provider && screen)
{
gtk_style_context_remove_provider_for_screen (
@@ -842,6 +848,12 @@ fe_apply_gtk3_theme_with_reload (const char *theme_name, gboolean force_reload,
gtk_style_context_reset_widgets (screen);
}
#ifdef G_OS_WIN32
/* Applying a GTK3 theme should immediately disable ZoiteChat's Win32
* fallback window CSS so buttons/chat widgets are fully theme-driven. */
fe_apply_windows_theme (dark);
#endif
g_free (gtk3_theme_provider_name);
gtk3_theme_provider_name = g_strdup (theme_name);
gtk3_theme_provider_dark = dark;