Public bug reported:

Binary package hint: light-themes

blocking_name = "audio-volume-muted-blocking-panel"
DESIGN_TEAM_SIZE = 22

when I use gtk_image_set_from_icon_name(speaker_image, blocked_name, 
DESIGN_TEAM_SIZE). This will set the icon to a red-muted icon. But if I attempt 
to load the icon via a pixbuf this will return the ordinary muted icon. It 
seems as if it cannot find the icon using the theme and falls back to the 
standard muted icon. This is the expected behaviour but I have been assured the 
icon should be in the theme and more importantly why does the first method work 
and the second does not. 
Please read the comments in the code below it should clarify things. 

        gchar* blocked_name = g_hash_table_lookup(volume_states, 
GINT_TO_POINTER(STATE_MUTED_WHILE_INPUT));
        // Maybe this is the incorrect icon theme.
        GtkIconTheme* theme = gtk_icon_theme_get_default();        
        // Strangely this thinks the theme has the icon
        g_debug("DOES the ICON THEME Have the Blocked image = %i", 
gtk_icon_theme_has_icon(theme, blocked_name));

        GdkPixbuf* blocked_buf = gtk_icon_theme_load_icon(theme, blocked_name,
                                                          22,
                                                          
GTK_ICON_LOOKUP_GENERIC_FALLBACK,
                                                          &error);
        if(error != NULL){
                    g_error("indicator-sound : 
catch_signal_sink_input_while_muted - %s", error->message);
                    g_error_free(error);
                    return;
        }        
        g_debug("gdk_pixbuf_get_width returns %i", 
gdk_pixbuf_get_width(blocked_buf));

        // This works 
        //gtk_image_set_from_icon_name(speaker_image, blocked_name, 
DESIGN_TEAM_SIZE);
        
        g_debug("DOES the ICON THEME Have the Blocked image = %i", 
gtk_icon_theme_has_icon(theme, blocked_name));
        gchar ** theme_path;         
        gint nelements = 1;

        gtk_icon_theme_get_search_path(theme, &theme_path, &nelements);
        g_debug("icon theme path is %s ", *theme_path);
        // This doesn't
        gtk_image_set_from_pixbuf(speaker_image, blocked_buf);

** Affects: light-themes (Ubuntu)
     Importance: Undecided
     Assignee: Kenneth Wimer (kwwii)
         Status: New

** Changed in: light-themes (Ubuntu)
     Assignee: (unassigned) => Kenneth Wimer (kwwii)

-- 
Wrong icon is returned from gtk_icon_theme_load_icon for mute blocking state
https://bugs.launchpad.net/bugs/535064
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to