[gtk+/rendering-cleanup: 89/142] x11: Create blank cursor without pixmaps



commit ed39115f710d96574394610f9394c9ea9f41635b
Author: Benjamin Otte <otte redhat com>
Date:   Fri Aug 27 16:00:09 2010 +0200

    x11: Create blank cursor without pixmaps

 gdk/x11/gdkcursor-x11.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c
index d4d44ec..1ef1a50 100644
--- a/gdk/x11/gdkcursor-x11.c
+++ b/gdk/x11/gdkcursor-x11.c
@@ -157,21 +157,21 @@ static Cursor
 get_blank_cursor (GdkDisplay *display)
 {
   GdkScreen *screen;
-  GdkPixmap *pixmap;
-  Pixmap source_pixmap;
+  Pixmap pixmap;
   XColor color;
   Cursor cursor;
+  cairo_surface_t *surface;
   cairo_t *cr;
 
   screen = gdk_display_get_default_screen (display);
-  pixmap = gdk_pixmap_new (gdk_screen_get_root_window (screen), 1, 1, 1);
-  /* Clear Pixmap */
-  cr = gdk_cairo_create (pixmap);
+  surface = _gdk_x11_window_create_bitmap_surface (gdk_screen_get_root_window (screen), 1, 1);
+  /* Clear surface */
+  cr = cairo_create (surface);
   cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
   cairo_paint (cr);
   cairo_destroy (cr);
  
-  source_pixmap = GDK_PIXMAP_XID (pixmap);
+  pixmap = cairo_xlib_surface_get_drawable (surface);
 
   color.pixel = 0; 
   color.red = color.blue = color.green = 0;
@@ -180,9 +180,9 @@ get_blank_cursor (GdkDisplay *display)
     cursor = None;
   else
     cursor = XCreatePixmapCursor (GDK_DISPLAY_XDISPLAY (display),
-                                  source_pixmap, source_pixmap,
+                                  pixmap, pixmap,
                                   &color, &color, 1, 1);
-  g_object_unref (pixmap);
+  cairo_surface_destroy (surface);
 
   return cursor;
 }



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