policykit-gnome r37 - trunk/src
- From: davidz svn gnome org
- To: svn-commits-list gnome org
- Subject: policykit-gnome r37 - trunk/src
- Date: Sat, 28 Jun 2008 20:45:52 +0000 (UTC)
Author: davidz
Date: Sat Jun 28 20:45:52 2008
New Revision: 37
URL: http://svn.gnome.org/viewvc/policykit-gnome?rev=37&view=rev
Log:
dup the pixbuf since we're modifying it
Modified:
trunk/src/polkit-gnome-auth-dialog.c
Modified: trunk/src/polkit-gnome-auth-dialog.c
==============================================================================
--- trunk/src/polkit-gnome-auth-dialog.c (original)
+++ trunk/src/polkit-gnome-auth-dialog.c Sat Jun 28 20:45:52 2008
@@ -380,16 +380,18 @@
polkit_gnome_auth_dialog_set_icon_name (PolkitGnomeAuthDialog *auth_dialog, const char *icon_name)
{
GdkPixbuf *pixbuf;
+ GdkPixbuf *copy_pixbuf;
GdkPixbuf *vendor_pixbuf;
pixbuf = NULL;
+ copy_pixbuf = NULL;
vendor_pixbuf = NULL;
vendor_pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
- icon_name,
- 48,
- 0,
- NULL);
+ icon_name,
+ 48,
+ 0,
+ NULL);
if (vendor_pixbuf == NULL)
goto out;
@@ -401,21 +403,27 @@
if (pixbuf == NULL)
goto out;
+ /* need to copy the pixbuf since we're modifying it */
+ copy_pixbuf = gdk_pixbuf_copy (pixbuf);
+ if (copy_pixbuf == NULL)
+ goto out;
+
/* blend the vendor icon in the bottom right quarter */
gdk_pixbuf_composite (vendor_pixbuf,
- pixbuf,
+ copy_pixbuf,
24, 24, 24, 24,
24, 24, 0.5, 0.5,
GDK_INTERP_BILINEAR,
255);
-
+
gtk_image_set_from_pixbuf (GTK_IMAGE (auth_dialog->priv->icon),
- pixbuf);
+ copy_pixbuf);
out:
-
if (pixbuf != NULL)
g_object_unref (pixbuf);
+ if (copy_pixbuf != NULL)
+ g_object_unref (copy_pixbuf);
if (vendor_pixbuf != NULL)
g_object_unref (vendor_pixbuf);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]