[Pkg-mozext-commits] [firetray] 45/399: fix gdk get visual depth

David Prévot taffit at alioth.debian.org
Tue Oct 29 18:23:11 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch dfsg-clean
in repository firetray.

commit 835f4055aa6ae54b68157ecaee04f5a63bf1036c
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Tue Sep 20 09:58:15 2011 +0200

    fix gdk get visual depth
---
 src/modules/MoztIconLinux.jsm |    5 +++--
 src/modules/gdk.jsm           |    1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/modules/MoztIconLinux.jsm b/src/modules/MoztIconLinux.jsm
index 035e961..e2237e3 100644
--- a/src/modules/MoztIconLinux.jsm
+++ b/src/modules/MoztIconLinux.jsm
@@ -150,7 +150,8 @@ mozt.IconLinux = {
     // prepare colors/alpha
     let colorMap = gdk.gdk_screen_get_system_colormap(gdk.gdk_screen_get_default());
     let visual = gdk.gdk_colormap_get_visual(colorMap);
-    let screenDepth = 24; // = visual.depth; // FIXME: was visual->depth
+    let visualDepth = gdk.gdk_visual_get_depth(visual);
+    LOG("colorMap="+colorMap+" visual="+visual+" visualDepth="+visualDepth);
     let fore = new gdk.GdkColor;
     fore.pixel = fore.red = fore.green = fore.blue = 0;
     let alpha  = new gdk.GdkColor;
@@ -165,7 +166,7 @@ mozt.IconLinux = {
     gdk.gdk_colormap_alloc_color(colorMap, alpha.address(), true, true);
 
     // build pixmap with rectangle
-    let pm = gdk.gdk_pixmap_new(null, w, h, screenDepth);
+    let pm = gdk.gdk_pixmap_new(null, w, h, visualDepth);
     let pmDrawable = ctypes.cast(pm, gdk.GdkDrawable.ptr);
     let cr = gdk.gdk_cairo_create(pmDrawable);
     gdk.gdk_cairo_set_source_color(cr, alpha.address());
diff --git a/src/modules/gdk.jsm b/src/modules/gdk.jsm
index a859a91..52029ca 100644
--- a/src/modules/gdk.jsm
+++ b/src/modules/gdk.jsm
@@ -126,6 +126,7 @@ function gdk_defines(lib) {
   lib.lazy_bind("gdk_pixbuf_composite", ctypes.void_t, this.GdkPixbuf.ptr, this.GdkPixbuf.ptr, ctypes.int, ctypes.int, ctypes.int, ctypes.int, ctypes.double, ctypes.double, ctypes.double, ctypes.double, ctypes.int, ctypes.int);
   lib.lazy_bind("gdk_screen_get_system_colormap", this.GdkColormap.ptr, this.GdkScreen.ptr);
   lib.lazy_bind("gdk_colormap_get_visual", this.GdkVisual.ptr, this.GdkColormap.ptr);
+  lib.lazy_bind("gdk_visual_get_depth", gobject.gint, this.GdkVisual.ptr);
   lib.lazy_bind("gdk_color_parse", gobject.gboolean, gobject.gchar.ptr, this.GdkColor.ptr);
   lib.lazy_bind("gdk_colormap_alloc_color", gobject.gboolean, this.GdkColormap.ptr, this.GdkColor.ptr, gobject.gboolean, gobject.gboolean);
   lib.lazy_bind("gdk_pixmap_new", this.GdkPixmap.ptr, this.GdkDrawable.ptr, gobject.gint, gobject.gint, gobject.gint);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firetray.git



More information about the Pkg-mozext-commits mailing list