diff options
author | Kristian Rietveld <kris@gtk.org> | 2009-09-25 18:16:06 +0200 |
---|---|---|
committer | Kristian Rietveld <kris@gtk.org> | 2009-09-25 18:51:55 +0200 |
commit | 785e55f87ddd364f2686a3bc5ed324ec629d7ef3 (patch) | |
tree | 55b951c05acd30ec6619e7bd66ef9c318e22941e /gdk/quartz/gdkcursor-quartz.c | |
parent | cdec2caaf3571dbaf0ccd52aab6a111b1bcb1307 (diff) | |
download | gtk+-785e55f87ddd364f2686a3bc5ed324ec629d7ef3.tar.gz |
Bug 596250 - Gdkcursor-quartz.c doesn't implement GDK_BLANK_CURSOR
Support GDK_BLANK_CURSOR. Patch by John Ralls.
Diffstat (limited to 'gdk/quartz/gdkcursor-quartz.c')
-rw-r--r-- | gdk/quartz/gdkcursor-quartz.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gdk/quartz/gdkcursor-quartz.c b/gdk/quartz/gdkcursor-quartz.c index 2431eb8aa4..651952f0c1 100644 --- a/gdk/quartz/gdkcursor-quartz.c +++ b/gdk/quartz/gdkcursor-quartz.c @@ -45,6 +45,21 @@ gdk_quartz_cursor_new_from_nscursor (NSCursor *nscursor, return cursor; } +static GdkCursor * +create_blank_cursor (void) +{ + NSCursor *nscursor; + NSImage *nsimage; + NSSize size = { 1.0, 1.0 }; + + nsimage = [[NSImage alloc] initWithSize:size]; + nscursor = [[NSCursor alloc] initWithImage:nsimage + hotSpot:NSMakePoint(0.0, 0.0)]; + [nsimage release]; + + return gdk_quartz_cursor_new_from_nscursor (nscursor, GDK_BLANK_CURSOR); +} + static gboolean get_bit (const guchar *data, gint width, @@ -79,7 +94,7 @@ create_builtin_cursor (GdkCursorType cursor_type) NSImage *image; NSCursor *nscursor; - if (cursor_type >= G_N_ELEMENTS (xcursors)) + if (cursor_type >= G_N_ELEMENTS (xcursors) || cursor_type < 0) return NULL; cursor = cached_xcursors[cursor_type]; @@ -210,6 +225,10 @@ gdk_cursor_new_for_display (GdkDisplay *display, case GDK_HAND2: nscursor = [NSCursor pointingHandCursor]; break; + case GDK_CURSOR_IS_PIXMAP: + return NULL; + case GDK_BLANK_CURSOR: + return create_blank_cursor (); default: return gdk_cursor_ref (create_builtin_cursor (cursor_type)); } |