[libwnck] core: Add Screen argument to _wnck_gdk_pixbuf_get_from_pixmap(), ...



commit bcfa20a542693b3baadf797795efbcb7c3afb423
Author: Vincent Untz <vuntz gnome org>
Date:   Thu Jan 20 00:19:14 2011 +0100

    core: Add Screen argument to _wnck_gdk_pixbuf_get_from_pixmap(), ...
    
    ... _wnck_cairo_surface_get_from_pixmap().

 libwnck/pager.c  |    2 +-
 libwnck/xutils.c |   16 +++++++++-------
 libwnck/xutils.h |    3 ++-
 3 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/libwnck/pager.c b/libwnck/pager.c
index 27aabb8..21c9412 100644
--- a/libwnck/pager.c
+++ b/libwnck/pager.c
@@ -2584,7 +2584,7 @@ wnck_pager_get_background (WnckPager *pager,
   if (p != None)
     {
       _wnck_error_trap_push ();
-      pix = _wnck_gdk_pixbuf_get_from_pixmap (p);
+      pix = _wnck_gdk_pixbuf_get_from_pixmap (WNCK_SCREEN_XSCREEN (pager->priv->screen), p);
       _wnck_error_trap_pop ();
     }
 
diff --git a/libwnck/xutils.c b/libwnck/xutils.c
index 54cb6e6..5256124 100644
--- a/libwnck/xutils.c
+++ b/libwnck/xutils.c
@@ -1648,7 +1648,8 @@ free_pixels (guchar *pixels, gpointer data)
 }
 
 static cairo_surface_t *
-_wnck_cairo_surface_get_from_pixmap (Pixmap xpixmap)
+_wnck_cairo_surface_get_from_pixmap (Screen *screen,
+                                     Pixmap  xpixmap)
 {
   cairo_surface_t *surface;
   Display *display;
@@ -1657,7 +1658,7 @@ _wnck_cairo_surface_get_from_pixmap (Pixmap xpixmap)
   unsigned int w_ret, h_ret, bw_ret, depth_ret;
   XWindowAttributes attrs;
 
-  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+  display = DisplayOfScreen (screen);
 
   if (!XGetGeometry (display, xpixmap, &root_return,
                      &x_ret, &y_ret, &w_ret, &h_ret, &bw_ret, &depth_ret))
@@ -1667,7 +1668,7 @@ _wnck_cairo_surface_get_from_pixmap (Pixmap xpixmap)
     {
       surface = cairo_xlib_surface_create_for_bitmap (display,
                                                       xpixmap,
-                                                      GDK_SCREEN_XSCREEN (gdk_screen_get_default ()),
+                                                      screen,
                                                       w_ret,
                                                       h_ret);
     }
@@ -1686,12 +1687,13 @@ _wnck_cairo_surface_get_from_pixmap (Pixmap xpixmap)
 }
 
 GdkPixbuf*
-_wnck_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap)
+_wnck_gdk_pixbuf_get_from_pixmap (Screen *screen,
+                                  Pixmap  xpixmap)
 {
   cairo_surface_t *surface;
   GdkPixbuf *retval;
 
-  surface = _wnck_cairo_surface_get_from_pixmap (xpixmap);
+  surface = _wnck_cairo_surface_get_from_pixmap (screen, xpixmap);
 
   if (surface == NULL)
     return NULL;
@@ -1727,10 +1729,10 @@ try_pixmap_and_mask (Screen     *screen,
 
   _wnck_error_trap_push ();
 
-  surface = _wnck_cairo_surface_get_from_pixmap (src_pixmap);
+  surface = _wnck_cairo_surface_get_from_pixmap (screen, src_pixmap);
 
   if (surface && src_mask != None)
-    mask_surface = _wnck_cairo_surface_get_from_pixmap (src_mask);
+    mask_surface = _wnck_cairo_surface_get_from_pixmap (screen, src_mask);
 
   _wnck_error_trap_pop ();
 
diff --git a/libwnck/xutils.h b/libwnck/xutils.h
index ea80e23..2b334a3 100644
--- a/libwnck/xutils.h
+++ b/libwnck/xutils.h
@@ -218,7 +218,8 @@ void _wnck_set_desktop_layout (Screen *xscreen,
                                int     rows,
                                int     columns);
 
-GdkPixbuf* _wnck_gdk_pixbuf_get_from_pixmap (Pixmap       xpixmap);
+GdkPixbuf* _wnck_gdk_pixbuf_get_from_pixmap (Screen *screen,
+                                             Pixmap  xpixmap);
 
 #define WNCK_NO_MANAGER_TOKEN 0
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]