Updated gtkutil_menu_icon_theme_variant() to select the menu icon theme variant from the app’s effective dark-mode state first (fe_dark_mode_state_is_initialized() + fe_dark_mode_is_enabled()), and only use GTK/theme-name heuristics as fallback before app state is initialized. This preserves the existing light-asset fallback behavior in menu icon loading logic.

Added a new frontend helper declaration fe_dark_mode_state_is_initialized() in the GTK frontend header so callers can check whether dark-mode state is ready.
Implemented dark-mode initialization tracking in fe-gtk.c via a new static flag, set when auto mode state is externally set and during fe_init(), and exposed it through fe_dark_mode_state_is_initialized().
This commit is contained in:
2026-02-25 22:31:52 -07:00
parent 51f8795d1a
commit cbc474477b
3 changed files with 15 additions and 0 deletions

View File

@@ -251,6 +251,9 @@ gtkutil_menu_icon_theme_variant (void)
char *theme_name_lower = NULL;
const char *theme_variant = "light";
if (fe_dark_mode_state_is_initialized ())
return fe_dark_mode_is_enabled () ? "dark" : "light";
settings = gtk_settings_get_default ();
if (settings)
{