]> git.sesse.net Git - vlc/commitdiff
Fix loading of the VLC icon
authorChristophe Mutricy <xtophe@videolan.org>
Wed, 25 Aug 2010 22:27:19 +0000 (23:27 +0100)
committerChristophe Mutricy <xtophe@videolan.org>
Wed, 25 Aug 2010 22:43:10 +0000 (23:43 +0100)
Both in installed and non-installed mode

modules/misc/notify/notify.c

index 9069e6d0705c0dcad03a104ea06b255c7ec6e2b6..6eb859a4714936b8a0667394ea66c1b6022b1afa 100644 (file)
@@ -34,6 +34,7 @@
 #include <vlc_playlist.h>
 #include <vlc_url.h>
 
+#include <gtk/gtk.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <libnotify/notify.h>
 
@@ -224,15 +225,23 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
     }
     else /* else we show state-of-the art logo */
     {
-        GError *p_error = NULL;
-        char *psz_pixbuf;
-        char *psz_data = config_GetDataDir( p_this );
-        if( asprintf( &psz_pixbuf, "%s/vlc48x48.png", psz_data ) >= 0 )
+        /* First try to get an icon from the current theme. */
+        GtkIconTheme* p_theme = gtk_icon_theme_get_default();
+        pix = gtk_icon_theme_load_icon( p_theme, "vlc", 72, 0, NULL);
+
+        if( !pix )
         {
-            pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error );
-            free( psz_pixbuf );
+        /* Load icon from share/ */
+            GError *p_error = NULL;
+            char *psz_pixbuf;
+            char *psz_data = config_GetDataDir( p_this );
+            if( asprintf( &psz_pixbuf, "%s/icons/48x48/vlc.png", psz_data ) >= 0 )
+            {
+                pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error );
+                free( psz_pixbuf );
+            }
+            free( psz_data );
         }
-        free( psz_data );
     }
 
     free( psz_arturl );