[gtk+] Bug 596250 - Gdkcursor-quartz.c doesn't implement GDK_BLANK_CURSOR
- From: Kristian Rietveld <kristian src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Bug 596250 - Gdkcursor-quartz.c doesn't implement GDK_BLANK_CURSOR
- Date: Fri, 25 Sep 2009 17:41:06 +0000 (UTC)
commit 785e55f87ddd364f2686a3bc5ed324ec629d7ef3
Author: Kristian Rietveld <kris gtk org>
Date: Fri Sep 25 18:16:06 2009 +0200
Bug 596250 - Gdkcursor-quartz.c doesn't implement GDK_BLANK_CURSOR
Support GDK_BLANK_CURSOR. Patch by John Ralls.
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 2431eb8..651952f 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));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]