Commit 8e3afc6e authored by Benjamin Otte's avatar Benjamin Otte Committed by Matthias Clasen

x11: Use public API to access cursor's xcursor

parent 3d5d5583
...@@ -200,15 +200,12 @@ gdk_device_core_set_window_cursor (GdkDevice *device, ...@@ -200,15 +200,12 @@ gdk_device_core_set_window_cursor (GdkDevice *device,
GdkWindow *window, GdkWindow *window,
GdkCursor *cursor) GdkCursor *cursor)
{ {
GdkCursorPrivate *cursor_private;
Cursor xcursor; Cursor xcursor;
cursor_private = (GdkCursorPrivate*) cursor;
if (!cursor) if (!cursor)
xcursor = None; xcursor = None;
else else
xcursor = cursor_private->xcursor; xcursor = gdk_x11_cursor_get_xcursor (cursor);
XDefineCursor (GDK_WINDOW_XDISPLAY (window), XDefineCursor (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), GDK_WINDOW_XID (window),
...@@ -362,7 +359,7 @@ gdk_device_core_grab (GdkDevice *device, ...@@ -362,7 +359,7 @@ gdk_device_core_grab (GdkDevice *device,
else else
{ {
_gdk_x11_cursor_update_theme (cursor); _gdk_x11_cursor_update_theme (cursor);
xcursor = ((GdkCursorPrivate *) cursor)->xcursor; xcursor = gdk_x11_cursor_get_xcursor (cursor);
} }
xevent_mask = 0; xevent_mask = 0;
......
...@@ -245,7 +245,6 @@ gdk_device_xi2_set_window_cursor (GdkDevice *device, ...@@ -245,7 +245,6 @@ gdk_device_xi2_set_window_cursor (GdkDevice *device,
GdkCursor *cursor) GdkCursor *cursor)
{ {
GdkDeviceXI2Private *priv; GdkDeviceXI2Private *priv;
GdkCursorPrivate *cursor_private;
priv = GDK_DEVICE_XI2 (device)->priv; priv = GDK_DEVICE_XI2 (device)->priv;
...@@ -255,12 +254,10 @@ gdk_device_xi2_set_window_cursor (GdkDevice *device, ...@@ -255,12 +254,10 @@ gdk_device_xi2_set_window_cursor (GdkDevice *device,
if (cursor) if (cursor)
{ {
cursor_private = (GdkCursorPrivate*) cursor;
XIDefineCursor (GDK_WINDOW_XDISPLAY (window), XIDefineCursor (GDK_WINDOW_XDISPLAY (window),
priv->device_id, priv->device_id,
GDK_WINDOW_XID (window), GDK_WINDOW_XID (window),
cursor_private->xcursor); gdk_x11_cursor_get_xcursor (cursor));
} }
else else
XIUndefineCursor (GDK_WINDOW_XDISPLAY (window), XIUndefineCursor (GDK_WINDOW_XDISPLAY (window),
...@@ -408,7 +405,7 @@ gdk_device_xi2_grab (GdkDevice *device, ...@@ -408,7 +405,7 @@ gdk_device_xi2_grab (GdkDevice *device,
else else
{ {
_gdk_x11_cursor_update_theme (cursor); _gdk_x11_cursor_update_theme (cursor);
xcursor = ((GdkCursorPrivate *) cursor)->xcursor; xcursor = gdk_x11_cursor_get_xcursor (cursor);
} }
mask.deviceid = priv->device_id; mask.deviceid = priv->device_id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment