be extra careful when generating pixbufs (should mean we just get no
2007-06-15 Jens Granseuer <jensgr@gmx.net> * appearance-desktop.c: (wp_props_load_wallpaper), (wp_scale_type_changed), (wp_shade_type_changed): * gnome-wp-utils.c: (gnome_wp_pixbuf_tile): be extra careful when generating pixbufs (should mean we just get no thumbs instead of assertion failures, bug #403160) svn path=/trunk/; revision=7728
This commit is contained in:
parent
a2ec246221
commit
1c5d2a43bd
3 changed files with 25 additions and 20 deletions
|
@ -1,3 +1,11 @@
|
|||
2007-06-15 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* appearance-desktop.c: (wp_props_load_wallpaper),
|
||||
(wp_scale_type_changed), (wp_shade_type_changed):
|
||||
* gnome-wp-utils.c: (gnome_wp_pixbuf_tile): be extra careful when
|
||||
generating pixbufs (should mean we just get no thumbs instead of
|
||||
assertion failures, bug #403160)
|
||||
|
||||
2007-06-14 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* Makefile.am:
|
||||
|
|
|
@ -130,22 +130,14 @@ wp_props_load_wallpaper (gchar *key,
|
|||
pixbuf = gnome_wp_item_get_thumbnail (item, data->wp_thumbs);
|
||||
gnome_wp_item_update_description (item);
|
||||
|
||||
gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter,
|
||||
0, pixbuf,
|
||||
1, item->description,
|
||||
2, item->filename,
|
||||
-1);
|
||||
|
||||
if (pixbuf != NULL)
|
||||
{
|
||||
gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter,
|
||||
0, pixbuf,
|
||||
1, item->description,
|
||||
2, item->filename,
|
||||
-1);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter,
|
||||
1, item->description,
|
||||
2, item->filename,
|
||||
-1);
|
||||
}
|
||||
|
||||
path = gtk_tree_model_get_path (data->wp_model, &iter);
|
||||
item->rowref = gtk_tree_row_reference_new (data->wp_model, path);
|
||||
|
@ -350,7 +342,8 @@ wp_scale_type_changed (GtkComboBox *combobox,
|
|||
&iter,
|
||||
0, pixbuf,
|
||||
-1);
|
||||
g_object_unref (pixbuf);
|
||||
if (pixbuf != NULL)
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
gconf_client_set_string (data->client, WP_OPTIONS_KEY, item->options, NULL);
|
||||
}
|
||||
|
@ -391,7 +384,9 @@ wp_shade_type_changed (GtkWidget *combobox,
|
|||
gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter,
|
||||
0, pixbuf,
|
||||
-1);
|
||||
g_object_unref (pixbuf);
|
||||
if (pixbuf != NULL)
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
gconf_client_set_string (data->client, WP_SHADING_KEY,
|
||||
item->shade_type, NULL);
|
||||
}
|
||||
|
@ -895,7 +890,7 @@ desktop_init (AppearanceData *data)
|
|||
GtkFileFilter *filter;
|
||||
|
||||
data->wp_update_gconf = TRUE;
|
||||
|
||||
|
||||
data->wp_hash = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
data->wp_thumbs = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL);
|
||||
|
@ -944,7 +939,7 @@ desktop_init (AppearanceData *data)
|
|||
"xpad", 5,
|
||||
"ypad", 5,
|
||||
NULL);
|
||||
|
||||
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (data->wp_view),
|
||||
data->wp_cell,
|
||||
TRUE);
|
||||
|
|
|
@ -36,7 +36,7 @@ GdkPixbuf * gnome_wp_pixbuf_new_gradient (GtkOrientation orientation,
|
|||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
|
||||
d = gdk_pixbuf_get_pixels (pixbuf);
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
|
||||
|
||||
dr = c2->red - c1->red;
|
||||
dg = c2->green - c1->green;
|
||||
db = c2->blue - c1->blue;
|
||||
|
@ -112,7 +112,7 @@ GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf,
|
|||
gdouble cx, cy;
|
||||
gint dwidth, dheight;
|
||||
gint swidth, sheight;
|
||||
guint alpha = 255;
|
||||
const guint alpha = 255;
|
||||
|
||||
if (dest_pixbuf == NULL) {
|
||||
return gdk_pixbuf_copy (src_pixbuf);
|
||||
|
@ -120,6 +120,8 @@ GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf,
|
|||
|
||||
tmpbuf = gdk_pixbuf_scale_simple (src_pixbuf, scaled_width, scaled_height,
|
||||
GDK_INTERP_BILINEAR);
|
||||
if (!tmpbuf)
|
||||
return NULL;
|
||||
|
||||
swidth = gdk_pixbuf_get_width (tmpbuf);
|
||||
sheight = gdk_pixbuf_get_height (tmpbuf);
|
||||
|
|
Loading…
Add table
Reference in a new issue