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>
|
2007-06-14 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
* Makefile.am:
|
* Makefile.am:
|
||||||
|
|
|
@ -130,22 +130,14 @@ wp_props_load_wallpaper (gchar *key,
|
||||||
pixbuf = gnome_wp_item_get_thumbnail (item, data->wp_thumbs);
|
pixbuf = gnome_wp_item_get_thumbnail (item, data->wp_thumbs);
|
||||||
gnome_wp_item_update_description (item);
|
gnome_wp_item_update_description (item);
|
||||||
|
|
||||||
if (pixbuf != NULL)
|
|
||||||
{
|
|
||||||
gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter,
|
gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter,
|
||||||
0, pixbuf,
|
0, pixbuf,
|
||||||
1, item->description,
|
1, item->description,
|
||||||
2, item->filename,
|
2, item->filename,
|
||||||
-1);
|
-1);
|
||||||
|
|
||||||
|
if (pixbuf != NULL)
|
||||||
g_object_unref (pixbuf);
|
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);
|
path = gtk_tree_model_get_path (data->wp_model, &iter);
|
||||||
item->rowref = gtk_tree_row_reference_new (data->wp_model, path);
|
item->rowref = gtk_tree_row_reference_new (data->wp_model, path);
|
||||||
|
@ -350,6 +342,7 @@ wp_scale_type_changed (GtkComboBox *combobox,
|
||||||
&iter,
|
&iter,
|
||||||
0, pixbuf,
|
0, pixbuf,
|
||||||
-1);
|
-1);
|
||||||
|
if (pixbuf != NULL)
|
||||||
g_object_unref (pixbuf);
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
gconf_client_set_string (data->client, WP_OPTIONS_KEY, item->options, NULL);
|
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,
|
gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter,
|
||||||
0, pixbuf,
|
0, pixbuf,
|
||||||
-1);
|
-1);
|
||||||
|
if (pixbuf != NULL)
|
||||||
g_object_unref (pixbuf);
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
gconf_client_set_string (data->client, WP_SHADING_KEY,
|
gconf_client_set_string (data->client, WP_SHADING_KEY,
|
||||||
item->shade_type, NULL);
|
item->shade_type, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf,
|
||||||
gdouble cx, cy;
|
gdouble cx, cy;
|
||||||
gint dwidth, dheight;
|
gint dwidth, dheight;
|
||||||
gint swidth, sheight;
|
gint swidth, sheight;
|
||||||
guint alpha = 255;
|
const guint alpha = 255;
|
||||||
|
|
||||||
if (dest_pixbuf == NULL) {
|
if (dest_pixbuf == NULL) {
|
||||||
return gdk_pixbuf_copy (src_pixbuf);
|
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,
|
tmpbuf = gdk_pixbuf_scale_simple (src_pixbuf, scaled_width, scaled_height,
|
||||||
GDK_INTERP_BILINEAR);
|
GDK_INTERP_BILINEAR);
|
||||||
|
if (!tmpbuf)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
swidth = gdk_pixbuf_get_width (tmpbuf);
|
swidth = gdk_pixbuf_get_width (tmpbuf);
|
||||||
sheight = gdk_pixbuf_get_height (tmpbuf);
|
sheight = gdk_pixbuf_get_height (tmpbuf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue