1
From 4451351603a55f43b6656697e269d2c25da52d46 Mon Sep 17 00:00:00 2001
2
From: Olivier Fourdan <fourdan@xfce.org>
3
Date: Wed, 26 Jan 2011 14:38:35 +0100
4
Subject: Allow images without an alpha channel to be used in themes as well
7
src/mypixmap.c | 4 +++-
8
1 files changed, 3 insertions(+), 1 deletions(-)
10
diff --git a/src/mypixmap.c b/src/mypixmap.c
11
index 906f851..aea0cd2 100644
14
@@ -800,6 +800,7 @@ xfwmPixmapDrawFromGdkPixbuf (xfwmPixmap * pm, GdkPixbuf *pixbuf)
18
+ gint alpha_threshold;
20
g_return_val_if_fail (pm != NULL, FALSE);
21
g_return_val_if_fail (pm->pixmap != None, FALSE);
22
@@ -858,9 +859,10 @@ xfwmPixmapDrawFromGdkPixbuf (xfwmPixmap * pm, GdkPixbuf *pixbuf)
23
gdk_draw_pixbuf (GDK_DRAWABLE (dest_pixmap), NULL, pixbuf, 0, 0, dest_x, dest_y,
24
width, height, GDK_RGB_DITHER_NONE, 0, 0);
26
+ alpha_threshold = (gdk_pixbuf_get_has_alpha (pixbuf) ? 0xFF : 0);
27
gdk_pixbuf_render_threshold_alpha (pixbuf, dest_bitmap,
29
- width, height, 0xFF);
30
+ width, height, alpha_threshold);
32
g_object_unref (cmap);
33
g_object_unref (dest_pixmap);