← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~cjcurran/indicator-sound/clearlooks_fix into lp:indicator-sound

 

Conor Curran has proposed merging lp:~cjcurran/indicator-sound/clearlooks_fix into lp:indicator-sound.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)
Related bugs:
  #537891 indicator-applet crashed with SIGSEGV in gdk_pixbuf_composite()
  https://bugs.launchpad.net/bugs/537891


Fixes the loading of icons for the mute blocking state so as it uses the libindicator loading code as opposed to its own fixed size approach. Fallbacks gracefully and as a result does not cause a seg fault at start up. 

-- 
https://code.launchpad.net/~cjcurran/indicator-sound/clearlooks_fix/+merge/21228
Your team ayatana-commits is subscribed to branch lp:indicator-sound.
=== modified file 'src/Makefile.am'
--- src/Makefile.am	2010-03-05 10:38:57 +0000
+++ src/Makefile.am	2010-03-12 11:02:17 +0000
@@ -43,8 +43,6 @@
     sound-service-dbus.h \
     sound-service-dbus.c \
     sound-service-server.h \
-    sound-service-marshal.c \
-    sound-service-marshal.h \
     slider-menu-item.h \
     slider-menu-item.c
 indicator_sound_service_CFLAGS = $(SOUNDSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall -Werror

=== modified file 'src/indicator-sound.c'
--- src/indicator-sound.c	2010-03-11 11:50:40 +0000
+++ src/indicator-sound.c	2010-03-12 11:02:17 +0000
@@ -40,7 +40,6 @@
 #include "dbus-shared-names.h"
 #include "sound-service-client.h"
 #include "common-defs.h"
-#include "sound-service-marshal.h"
 
 // GObject Boiler plate
 #define INDICATOR_SOUND_TYPE            (indicator_sound_get_type ())
@@ -323,32 +322,18 @@
 */
 static void prepare_blocked_animation()
 {
-    GError* error= NULL;
-    int i;
-
     gchar* blocked_name = g_hash_table_lookup(volume_states, GINT_TO_POINTER(STATE_MUTED_WHILE_INPUT));
     gchar* muted_name = g_hash_table_lookup(volume_states, GINT_TO_POINTER(STATE_MUTED));
-    GtkIconTheme* theme = gtk_icon_theme_get_default();        
-    GdkPixbuf* mute_buf = gtk_icon_theme_load_icon(theme, 
-                                                    muted_name,
-                                                    22,
-                                                    GTK_ICON_LOOKUP_GENERIC_FALLBACK,
-                                                    &error);
-    if(error != NULL){
-	    g_error("indicator-sound : prepare_blocked_animation - %s", error->message);
-	    g_error_free(error);
-	    return;
-    }        
-
-    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 : prepare_blocked_animation - %s", error->message);
-	    g_error_free(error);
-	    return;
-    }      
+    
+    GtkImage* temp_image = indicator_image_helper(muted_name);       
+    GdkPixbuf* mute_buf = gtk_image_get_pixbuf(temp_image); 
+
+    temp_image = indicator_image_helper(blocked_name);       
+
+    GdkPixbuf* blocked_buf = gtk_image_get_pixbuf(temp_image);
+
+    int i;
+    
     // sample 22 snapshots - range : 0-256
     for(i = 0; i < 23; i++)
     {        
@@ -356,7 +341,6 @@
                              gdk_pixbuf_get_width(mute_buf),
                              gdk_pixbuf_get_height(mute_buf), 
                              0, 0, 1, 1, GDK_INTERP_BILINEAR, MIN(255, i * 11));
-        g_debug("creating blocking animation - alpha value = %i", MIN(255, i * 11));
         blocked_animation_list = g_list_append(blocked_animation_list, gdk_pixbuf_copy(blocked_buf));
     }   
 }

=== modified file 'src/sound-service-dbus.c'
--- src/sound-service-dbus.c	2010-03-08 19:12:18 +0000
+++ src/sound-service-dbus.c	2010-03-12 11:02:17 +0000
@@ -26,7 +26,6 @@
 #include "dbus-shared-names.h"
 #include "sound-service-dbus.h"
 #include "common-defs.h"
-#include "sound-service-marshal.h"
 #include "pulse-manager.h"
 
 // DBUS methods 


Follow ups