From 2b98f0651ce651143d3d2100e6092b3b7fc1b8a4 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Sat, 28 Mar 2026 10:48:39 +0100 Subject: [PATCH] fix(ui): fall back to Adwaita when system icon theme is broken MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the configured icon theme (e.g. Sweet-Blue) doesn't exist on disk, GTK falls back to hicolor which has almost no icons. Detect this by probing for a standard icon, and set Adwaita as the theme — it's guaranteed to exist as a GTK4 dependency. This replaces the broken add_search_path("/usr/share/icons/Adwaita") approach which doesn't work because search paths are scoped to the active theme name, not the directory name. --- crates/owlry/src/app.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/owlry/src/app.rs b/crates/owlry/src/app.rs index ee6cc5f..31e95ed 100644 --- a/crates/owlry/src/app.rs +++ b/crates/owlry/src/app.rs @@ -185,16 +185,19 @@ impl OwlryApp { } fn setup_icon_theme() { - // Ensure we have icon fallbacks for weather/media icons - // These may not exist in all icon themes if let Some(display) = gtk4::gdk::Display::default() { let icon_theme = gtk4::IconTheme::for_display(&display); - // Add Adwaita as fallback search path (has weather and media icons) - icon_theme.add_search_path("/usr/share/icons/Adwaita"); - icon_theme.add_search_path("/usr/share/icons/breeze"); - - debug!("Icon theme search paths configured with Adwaita/breeze fallbacks"); + // If the system icon theme can't resolve standard icons (e.g., the + // configured theme doesn't exist on disk), fall back to Adwaita + // which is guaranteed to be installed as a GTK4 dependency. + if !icon_theme.has_icon("edit-find-symbolic") { + debug!( + "System icon theme '{}' cannot resolve standard icons, falling back to Adwaita", + icon_theme.theme_name() + ); + icon_theme.set_theme_name(Some("Adwaita")); + } } }