From 335a8f4d6b4a90ca738438f963e1f76202c70f8c Mon Sep 17 00:00:00 2001 From: deepend Date: Tue, 17 Feb 2026 23:12:34 -0700 Subject: [PATCH] Added stronger icon fallback handling for zc-menu-* menu items (including Server dropdown icons and Preferences) by introducing alternate fallback icon names and choosing an alternate only when the primary fallback icon is unavailable in the active icon theme. This specifically improves connect, disconnect, join, and preferences cases on Windows theme variations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kept the custom resource/file loading path in place (resource SVG + installed file fallback), then layered the improved theme fallback selection after it so menu icons still resolve if resource decoding is unavailable. Added emoji entry fallback logic: if GTK’s built-in show-emoji-icon leaves the secondary icon empty, the input box now picks the first available icon from a fallback list (face-smile-symbolic, face-smile, insert-emoticon-symbolic, insert-emoticon) --- src/fe-gtk/menu.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index 95f4f380..1661d6bd 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -2135,6 +2135,10 @@ create_icon_menu (char *labeltext, void *stock_name, int is_stock) const char *theme_variant = "light"; char *resource_path; const char *custom_fallback_icon = NULL; +<<<<<<< ours +======= + const char *custom_alt_fallback_icon = NULL; +>>>>>>> theirs GdkPixbuf *custom_pixbuf = NULL; #endif #if !HAVE_GTK3 @@ -2188,15 +2192,27 @@ create_icon_menu (char *labeltext, void *stock_name, int is_stock) else if (g_str_equal (custom_icon, "quit")) custom_fallback_icon = "application-exit"; else if (g_str_equal (custom_icon, "disconnect")) - custom_fallback_icon = "network-offline"; + { + custom_fallback_icon = "network-disconnect"; + custom_alt_fallback_icon = "network-offline"; + } else if (g_str_equal (custom_icon, "connect")) - custom_fallback_icon = "network-transmit-receive"; + { + custom_fallback_icon = "network-connect"; + custom_alt_fallback_icon = "network-transmit-receive"; + } else if (g_str_equal (custom_icon, "join")) + { custom_fallback_icon = "list-add"; + custom_alt_fallback_icon = "go-jump"; + } else if (g_str_equal (custom_icon, "chanlist")) custom_fallback_icon = "view-list"; else if (g_str_equal (custom_icon, "preferences")) + { custom_fallback_icon = "preferences-system"; + custom_alt_fallback_icon = "preferences-desktop"; + } else if (g_str_equal (custom_icon, "clear")) custom_fallback_icon = "edit-clear"; else if (g_str_equal (custom_icon, "save")) @@ -2260,9 +2276,18 @@ create_icon_menu (char *labeltext, void *stock_name, int is_stock) if (!image) { + GtkIconTheme *icon_theme = gtk_icon_theme_get_default (); + icon_name = custom_fallback_icon ? custom_fallback_icon : gtkutil_icon_name_from_stock (stock_name); if (!icon_name) icon_name = gtkutil_icon_name_from_stock (stock_name); + + if (icon_theme && custom_alt_fallback_icon && icon_name && !gtk_icon_theme_has_icon (icon_theme, icon_name) + && gtk_icon_theme_has_icon (icon_theme, custom_alt_fallback_icon)) + { + icon_name = custom_alt_fallback_icon; + } + if (!icon_name) icon_name = stock_name; if (icon_name)