[Xfce4-commits] <xfwm4:master> Allow images without an alpha channel to be used in themes as well

Olivier Fourdan noreply at xfce.org
Wed Jan 26 14:40:01 CET 2011


Updating branch refs/heads/master
         to 67944881a32d0b219559a4b021c49b23fd5e4dc4 (commit)
       from ef6e13761bf29dd87fde57ecacbed42f8244b748 (commit)

commit 67944881a32d0b219559a4b021c49b23fd5e4dc4
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Wed Jan 26 14:38:35 2011 +0100

    Allow images without an alpha channel to be used in themes as well

 src/mypixmap.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mypixmap.c b/src/mypixmap.c
index 906f851..aea0cd2 100644
--- a/src/mypixmap.c
+++ b/src/mypixmap.c
@@ -800,6 +800,7 @@ xfwmPixmapDrawFromGdkPixbuf (xfwmPixmap * pm, GdkPixbuf *pixbuf)
     GdkColormap *cmap;
     gint width, height;
     gint dest_x, dest_y;
+    gint alpha_threshold;
 
     g_return_val_if_fail (pm != NULL, FALSE);
     g_return_val_if_fail (pm->pixmap != None, FALSE);
@@ -858,9 +859,10 @@ xfwmPixmapDrawFromGdkPixbuf (xfwmPixmap * pm, GdkPixbuf *pixbuf)
     gdk_draw_pixbuf (GDK_DRAWABLE (dest_pixmap), NULL, pixbuf, 0, 0, dest_x, dest_y,
                      width, height, GDK_RGB_DITHER_NONE, 0, 0);
 
+    alpha_threshold = (gdk_pixbuf_get_has_alpha (pixbuf) ? 0xFF : 0);
     gdk_pixbuf_render_threshold_alpha (pixbuf, dest_bitmap,
                                        0, 0, dest_x, dest_y,
-                                       width, height, 0xFF);
+                                       width, height, alpha_threshold);
 
     g_object_unref (cmap);
     g_object_unref (dest_pixmap);



More information about the Xfce4-commits mailing list