From 6d0b51c10c04a61220cf49f1f37517607b3d3d6e Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 10 Jul 2009 20:28:01 +0100 Subject: [PATCH] Implement set_window_cursor() for GdkDeviceCore. --- gdk/x11/gdkdevice-core.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gdk/x11/gdkdevice-core.c b/gdk/x11/gdkdevice-core.c index 789c4007b7..2f1317a2a8 100644 --- a/gdk/x11/gdkdevice-core.c +++ b/gdk/x11/gdkdevice-core.c @@ -19,11 +19,16 @@ #include #include "gdkdevice-core.h" +#include "gdkprivate-x11.h" +#include "gdkx.h" static void gdk_device_core_get_state (GdkDevice *device, GdkWindow *window, gdouble *axes, GdkModifierType *mask); +static void gdk_device_core_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor); G_DEFINE_TYPE (GdkDeviceCore, gdk_device_core, GDK_TYPE_DEVICE) @@ -39,6 +44,7 @@ gdk_device_core_class_init (GdkDeviceCoreClass *klass) GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); device_class->get_state = gdk_device_core_get_state; + device_class->set_window_cursor = gdk_device_core_set_window_cursor; } static void @@ -71,3 +77,23 @@ gdk_device_core_get_state (GdkDevice *device, axes[1] = y_int; } } + +static void +gdk_device_core_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor) +{ + GdkCursorPrivate *cursor_private; + Cursor xcursor; + + cursor_private = (GdkCursorPrivate*) cursor; + + if (!cursor) + xcursor = None; + else + xcursor = cursor_private->xcursor; + + XDefineCursor (GDK_WINDOW_XDISPLAY (window), + GDK_WINDOW_XID (window), + xcursor); +}