diff options
author | Timm Bäder <mail@baedert.org> | 2019-09-29 08:39:12 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2019-10-09 16:57:22 +0200 |
commit | bcd894176989056774345bc35cee0a18a619d090 (patch) | |
tree | 60761622875e032094b1105e7666e1406e4f9ba5 | |
parent | 355d3f070a1c0185e2f1bcbeebd31a58c73ac14b (diff) | |
download | gtk+-bcd894176989056774345bc35cee0a18a619d090.tar.gz |
widget-factory: Skip xml files in background selection dialog
The default contains a xml file for an animated background, so don't try
loading it as a pixbuf.
-rw-r--r-- | demos/widget-factory/widget-factory.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 5be2f97dac..4af47abf0d 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -1003,6 +1003,9 @@ populate_flowbox (GtkWidget *flowbox) while ((name = g_dir_read_name (dir)) != NULL) { + if (g_str_has_suffix (name, ".xml")) + continue; + filename = g_build_filename (location, name, NULL); file = g_file_new_for_path (filename); stream = G_INPUT_STREAM (g_file_read (file, NULL, &error)); @@ -1017,7 +1020,7 @@ populate_flowbox (GtkWidget *flowbox) bd = g_new (BackgroundData, 1); bd->flowbox = flowbox; bd->filename = filename; - gdk_pixbuf_new_from_stream_at_scale_async (stream, 110, 110, TRUE, NULL, + gdk_pixbuf_new_from_stream_at_scale_async (stream, 110, 110, TRUE, NULL, background_loaded_cb, bd); } |