~ubuntu-branches/ubuntu/quantal/gnome-paint/quantal

« back to all changes in this revision

Viewing changes to src/toolbar.c

  • Committer: Bazaar Package Importer
  • Author(s): Aron Xu
  • Date: 2011-05-24 06:21:35 UTC
  • Revision ID: james.westby@ubuntu.com-20110524062135-eldh60p941pk5w3i
Tags: 0.4.0-3
* debian/patches/lp-757607-crash-in-toolbar.patch:
  + Fix a crash by clicking pencil then painter at toolbar.
    Thanks Juan Balderas for supplying the patch. (LP: #757607)
* debian/control:
  - Change to @debian.org email address.
  - Remove DMUA since not needed anymore.
  - Update std-ver to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
497
497
static GtkWidget * 
498
498
get_gtk_image ( GtkWidget *widget, gchar** xpm )
499
499
{
500
 
        GdkPixmap *gdkpixmap    = NULL;
501
 
    GdkBitmap *mask             = NULL;
 
500
        GdkPixbuf *pixbuf               = NULL;
502
501
    GtkWidget *gtkimage         = NULL;
503
 
        gdkpixmap = gdk_pixmap_create_from_xpm_d(widget->window, &mask, NULL, xpm);
504
 
        g_assert ( gdkpixmap );
505
 
        gtkimage = gtk_image_new_from_pixmap(gdkpixmap, mask);
506
 
    g_assert ( gtkimage );
507
 
        g_object_unref ( G_OBJECT(gdkpixmap) );
508
 
    g_object_unref ( G_OBJECT(mask) ); 
 
502
 
 
503
        pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
 
504
 
 
505
        if(!gdk_pixbuf_get_has_alpha (pixbuf))
 
506
        {
 
507
                GdkPixbuf *tmp;
 
508
 
 
509
                tmp = gdk_pixbuf_add_alpha (pixbuf, FALSE, 0, 0, 0);
 
510
                if(GDK_IS_PIXBUF(tmp)){ g_object_unref(pixbuf); pixbuf = tmp; }
 
511
        }
 
512
        gtkimage = gtk_image_new_from_pixbuf (pixbuf);
 
513
 
 
514
        if(GDK_IS_PIXBUF(pixbuf)){ g_object_unref(pixbuf); }
 
515
 
509
516
        gtk_widget_show(gtkimage);
510
517
        return gtkimage;
511
518
}