Wrong icon is returned from gtk_icon_theme_load_icon for mute blocking state

Bug #535064 reported by Conor Curran
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-mono (Ubuntu)
Fix Released
Low
Kenneth Wimer

Bug Description

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);

Conor Curran (cjcurran)
Changed in light-themes (Ubuntu):
assignee: nobody → Kenneth Wimer (kwwii)
Revision history for this message
Ted Gould (ted) wrote :

Try to use "gtk_icon_theme_lookup_icon" and get the Icon information and print out the filename (gtk_icon_info_get_filename ). I'd guess that perhaps the theme is different somehow. It'd be interesting to know which files it's actually referring two in the two cases.

Revision history for this message
Conor Curran (cjcurran) wrote :

in answer to Ted above here is the trace from the running application

** (indicator-loader:14587): DEBUG: DOES the ICON THEME Have the Blocked image = 1
** (indicator-loader:14587): DEBUG: The icon name of the buffer icon /usr/share/icons/ubuntu-mono-dark/status/22/audio-volume-muted.svg
** (indicator-loader:14587): DEBUG: gdk_pixbuf_get_width returns 22
** (indicator-loader:14587): DEBUG: DOES the ICON THEME Have the Blocked image = 1
** (indicator-loader:14587): DEBUG: icon theme path is /home/ronoc/.icons

Revision history for this message
Ted Gould (ted) wrote : Re: [Bug 535064] Re: Wrong icon is returned from gtk_icon_theme_load_icon for mute blocking state

So I think that this bug is because there isn't the correct icon name
used by someone :)

ted@shi:/usr/share/icons/ubuntu-mono-dark/status/22$ ls audio-volume-
audio-volume-blocking-panel.svg audio-volume-low-zero-panel.svg
audio-volume-high-panel.svg audio-volume-medium-panel.svg
audio-volume-high.svg audio-volume-medium.svg
audio-volume-low-panel.svg audio-volume-muted-panel.svg
audio-volume-low.svg audio-volume-muted.svg

There is no audio-volume-muted-blocking-panel.svg. So a search for that
falls back to "audio-volume-muted-blocking" then "audio-volume-muted"
which is what gets used.

Kenneth Wimer (kwwii)
Changed in light-themes (Ubuntu):
status: New → Fix Committed
Revision history for this message
Kenneth Wimer (kwwii) wrote :

Duh, fixed.

tags: added: kernel-series-unknown
tags: removed: kernel-series-unknown
affects: light-themes (Ubuntu) → ubuntu-mono (Ubuntu)
affects: ubuntu-mono (Ubuntu) → indicator-sound (Ubuntu)
Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue is an ubuntu-mono and will be fixed in the next upload

affects: indicator-sound (Ubuntu) → ubuntu-mono (Ubuntu)
Changed in ubuntu-mono (Ubuntu):
importance: Undecided → Low
Matthias Klumpp (ximion)
Changed in ubuntu-mono (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.