[Xfce4-commits] r30353 - in libexo/branches/xfce_4_6: . exo

Nick Schermer nick at xfce.org
Sun Jul 19 18:02:03 CEST 2009


Author: nick
Date: 2009-07-19 16:02:02 +0000 (Sun, 19 Jul 2009)
New Revision: 30353

Modified:
   libexo/branches/xfce_4_6/NEWS
   libexo/branches/xfce_4_6/exo/exo-toolbars-editor.c
   libexo/branches/xfce_4_6/exo/exo-toolbars-view.c
Log:
Backport the pixbuf fixes from trunk.


Modified: libexo/branches/xfce_4_6/NEWS
===================================================================
--- libexo/branches/xfce_4_6/NEWS	2009-07-19 15:58:43 UTC (rev 30352)
+++ libexo/branches/xfce_4_6/NEWS	2009-07-19 16:02:02 UTC (rev 30353)
@@ -2,6 +2,7 @@
 =======
 - Allow all arguments in the terminal parameters (part of bug #5301).
 - Fix some issues in exo-open with spaces in arguments.
+- Properly handle NULL pixbufs in the toolbars code.
 
 0.3.101
 =======

Modified: libexo/branches/xfce_4_6/exo/exo-toolbars-editor.c
===================================================================
--- libexo/branches/xfce_4_6/exo/exo-toolbars-editor.c	2009-07-19 15:58:43 UTC (rev 30352)
+++ libexo/branches/xfce_4_6/exo/exo-toolbars-editor.c	2009-07-19 16:02:02 UTC (rev 30353)
@@ -340,12 +340,14 @@
     {
       gtk_image_get_stock (image, &stock_id, NULL);
       pixbuf = gtk_widget_render_icon (widget, stock_id, GTK_ICON_SIZE_LARGE_TOOLBAR, NULL);
-      gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
+      if (G_LIKELY (pixbuf != NULL))
+        gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
     }
   else if (type == GTK_IMAGE_PIXBUF)
     {
       pixbuf = gtk_image_get_pixbuf (image);
-      gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
+      if (G_LIKELY (pixbuf != NULL))
+        gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
     }
 }
 

Modified: libexo/branches/xfce_4_6/exo/exo-toolbars-view.c
===================================================================
--- libexo/branches/xfce_4_6/exo/exo-toolbars-view.c	2009-07-19 15:58:43 UTC (rev 30352)
+++ libexo/branches/xfce_4_6/exo/exo-toolbars-view.c	2009-07-19 16:02:02 UTC (rev 30353)
@@ -528,8 +528,11 @@
       id = "separator";
 
       pixbuf = _exo_toolbars_new_separator_pixbuf ();
-      gtk_drag_source_set_icon_pixbuf (item, pixbuf);
-      g_object_unref (G_OBJECT (pixbuf));
+      if (G_LIKELY (pixbuf != NULL))
+        {
+          gtk_drag_source_set_icon_pixbuf (item, pixbuf);
+          g_object_unref (G_OBJECT (pixbuf));
+        }
     }
   else
     {
@@ -540,8 +543,11 @@
         stock_id = g_strdup (GTK_STOCK_DND);
 
       pixbuf = gtk_widget_render_icon (item, stock_id, GTK_ICON_SIZE_LARGE_TOOLBAR, NULL);
-      gtk_drag_source_set_icon_pixbuf (item, pixbuf);
-      g_object_unref (G_OBJECT (pixbuf));
+      if (G_LIKELY (pixbuf != NULL))
+        {
+          gtk_drag_source_set_icon_pixbuf (item, pixbuf);
+          g_object_unref (G_OBJECT (pixbuf));
+        }
 
       g_free (stock_id);
     }




More information about the Xfce4-commits mailing list