Updating branch refs/heads/master
         to e85e3412a65d710d41c25e3af734d68826edac34 (commit)
       from 9a9c809063fb9e0cc0778cf5efdd6c2057d7aefe (commit)

commit e85e3412a65d710d41c25e3af734d68826edac34
Author: Evangelos Foutras <evange...@foutrelis.com>
Date:   Wed Mar 6 05:58:54 2013 +0200

    Port fix for bug #9892 from the xfce-4.10 branch
    
    With the recent addition of per-workspace wallpapers (commit
    88a920697b22b0653f244ede15f8e645ae013139) this bug is much harder to
    trigger but can still manifest when an invalid image is selected and
    style is set to Tiled. (xfce_backdrop_get_pixbuf() will hang in a for
    loop.)
    
    This commit ports the original fix for consistency and correctness
    reasons. In addition, it also addresses the following warning which
    appears when style is set to None:
    
      ** (xfdesktop:3236): CRITICAL **: Invalid image style: 0

 src/xfce-backdrop.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c
index 4b3a909..a2bd53b 100644
--- a/src/xfce-backdrop.c
+++ b/src/xfce-backdrop.c
@@ -845,6 +845,8 @@ GdkPixbuf *
 xfce_backdrop_get_pixbuf(XfceBackdrop *backdrop)
 {
     GdkPixbuf *final_image, *image = NULL, *tmp;
+    GdkPixbufFormat *format = NULL;
+    gboolean apply_backdrop_image = FALSE;
     gint i, j;
     gint w, h, iw = 0, ih = 0;
     XfceBackdropImageStyle istyle;
@@ -856,7 +858,10 @@ xfce_backdrop_get_pixbuf(XfceBackdrop *backdrop)
     
     if(backdrop->priv->image_style != XFCE_BACKDROP_IMAGE_NONE &&
        backdrop->priv->image_path) {
-        gdk_pixbuf_get_file_info(backdrop->priv->image_path, &iw, &ih);
+        format = gdk_pixbuf_get_file_info(backdrop->priv->image_path, &iw, 
&ih);
+        /* make sure we have a usable backdrop image */
+        if(format != NULL)
+            apply_backdrop_image = TRUE;
     }
 
     if(backdrop->priv->width == 0 || backdrop->priv->height == 0) {
@@ -879,9 +884,7 @@ xfce_backdrop_get_pixbuf(XfceBackdrop *backdrop)
             final_image = create_solid(&backdrop->priv->color1, w, h, FALSE, 
0xff);
     }
     
-    /*check if the file exists,
-     *and if it doesn't then make the background the single colour*/
-    if(!g_file_test(backdrop->priv->image_path, G_FILE_TEST_EXISTS)) {
+    if(!apply_backdrop_image) {
         if(backdrop->priv->brightness != 0)
             final_image = adjust_brightness(final_image, 
backdrop->priv->brightness);
         
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to