[gtk+] x11: Use X11 variables instead of GDK variables



commit d8d8059ee1c2c789374d075592c0e5f5b04f97a5
Author: Benjamin Otte <otte redhat com>
Date:   Thu Nov 3 05:46:46 2016 +0100

    x11: Use X11 variables instead of GDK variables
    
    This way, we avoid GdkVisual usage.

 gdk/x11/gdkwindow-x11.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 675293b..f1b2c07 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -599,20 +599,23 @@ gdk_x11_window_create_pixmap_surface (GdkWindow *window,
                                       int        width,
                                       int        height)
 {
-  GdkScreen *screen = gdk_window_get_screen (window);
-  GdkVisual *visual = gdk_screen_get_system_visual (screen);
+  GdkDisplay *display;
+  Display *dpy;
   cairo_surface_t *surface;
   Pixmap pixmap;
 
-  pixmap = XCreatePixmap (GDK_WINDOW_XDISPLAY (window),
+  display = gdk_window_get_display (window);
+  dpy = GDK_DISPLAY_XDISPLAY (display);
+
+  pixmap = XCreatePixmap (dpy,
                           GDK_WINDOW_XID (window),
                           width, height,
-                          gdk_visual_get_depth (visual));
-  surface = cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (window),
+                          DefaultDepth (dpy, DefaultScreen (dpy)));
+  surface = cairo_xlib_surface_create (dpy,
                                        pixmap,
-                                       GDK_VISUAL_XVISUAL (visual),
+                                       DefaultVisual (dpy, DefaultScreen (dpy)),
                                        width, height);
-  attach_free_pixmap_handler (surface, GDK_WINDOW_DISPLAY (window), pixmap);
+  attach_free_pixmap_handler (surface, display, pixmap);
 
   return surface;
 }


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