Author: kelnos
Date: 2007-02-25 01:47:21 +0000 (Sun, 25 Feb 2007)
New Revision: 25031

Modified:
   xfdesktop/branches/xfce_4_4/src/xfce-backdrop.c
Log:
backport fix for bug #2939


Modified: xfdesktop/branches/xfce_4_4/src/xfce-backdrop.c
===================================================================
--- xfdesktop/branches/xfce_4_4/src/xfce-backdrop.c     2007-02-25 01:37:08 UTC 
(rev 25030)
+++ xfdesktop/branches/xfce_4_4/src/xfce-backdrop.c     2007-02-25 01:47:21 UTC 
(rev 25031)
@@ -575,11 +575,27 @@
     } else
         istyle = backdrop->priv->image_style;
     
-    if(backdrop->priv->bpp < 24)
-        interp = GDK_INTERP_HYPER;
-    else
-        interp = GDK_INTERP_BILINEAR;
+    /* if the image is the same as the screen size, there's no reason to do
+     * any scaling at all */
+    if(w == iw && h == ih)
+        istyle = XFCE_BACKDROP_IMAGE_CENTERED;
     
+    /* if we don't need to do any scaling, don't do any interpolation.  this
+     * fixes a problem where hyper/bilinear filtering causes blurriness in
+     * some images.  http://bugzilla.xfce.org/show_bug.cgi?id=2939 */
+    if(XFCE_BACKDROP_IMAGE_TILED == istyle
+       || XFCE_BACKDROP_IMAGE_CENTERED == istyle)
+    {
+        interp = GDK_INTERP_NEAREST;
+    } else {
+        /* if the screen has a bit depth of less than 24bpp, using bilinear
+         * filtering looks crappy (mainly with gradients). */
+        if(backdrop->priv->bpp < 24)
+            interp = GDK_INTERP_HYPER;
+        else
+            interp = GDK_INTERP_BILINEAR;
+    }
+    
     switch(istyle) {
         case XFCE_BACKDROP_IMAGE_CENTERED:
             dx = MAX((w - iw) / 2, 0);

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to