~laney/ubuntu/utopic/xfvm4/trunk

« back to all changes in this revision

Viewing changes to debian/patches/0001-Allow-images-without-an-alpha-channel-to-be-used-in-.patch

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2011-01-27 21:02:27 UTC
  • Revision ID: james.westby@ubuntu.com-20110127210227-1ngf5rr6wvmua8gw
Tags: 4.8.0-0ubuntu2
* debian/patches:
  - 0001-Allow-images-without-an-alpha-channel-to-be-used-in-.patch: fix
    disappearing window buttons for PNGs without alpha channel (should fix
    the optipng'd "greybird").
  - series: add the patch above.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
 
 
6
---
 
7
 src/mypixmap.c |    4 +++-
 
8
 1 files changed, 3 insertions(+), 1 deletions(-)
 
9
 
 
10
diff --git a/src/mypixmap.c b/src/mypixmap.c
 
11
index 906f851..aea0cd2 100644
 
12
--- a/src/mypixmap.c
 
13
+++ b/src/mypixmap.c
 
14
@@ -800,6 +800,7 @@ xfwmPixmapDrawFromGdkPixbuf (xfwmPixmap * pm, GdkPixbuf *pixbuf)
 
15
     GdkColormap *cmap;
 
16
     gint width, height;
 
17
     gint dest_x, dest_y;
 
18
+    gint alpha_threshold;
 
19
 
 
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);
 
25
 
 
26
+    alpha_threshold = (gdk_pixbuf_get_has_alpha (pixbuf) ? 0xFF : 0);
 
27
     gdk_pixbuf_render_threshold_alpha (pixbuf, dest_bitmap,
 
28
                                        0, 0, dest_x, dest_y,
 
29
-                                       width, height, 0xFF);
 
30
+                                       width, height, alpha_threshold);
 
31
 
 
32
     g_object_unref (cmap);
 
33
     g_object_unref (dest_pixmap);
 
34
-- 
 
35
1.7.2.3
 
36