From: Timm Bäder Date: Sun, 29 Sep 2019 06:39:12 +0000 (+0200) Subject: widget-factory: Skip xml files in background selection dialog X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~780 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bcd894176989056774345bc35cee0a18a619d090;p=gtk4.git 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. --- 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); }