]> Pileus Git - ~andy/gtk/commitdiff
x11: Create blank cursor without pixmaps
authorBenjamin Otte <otte@redhat.com>
Fri, 27 Aug 2010 14:00:09 +0000 (16:00 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:30 +0000 (15:11 +0200)
gdk/x11/gdkcursor-x11.c

index d4d44eca4dfefdc7e00d3465ab458cfc492f1a60..1ef1a5000b5c6f5efdbee52cf42d7ebbe5ba256e 100644 (file)
@@ -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;
 }