mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 11:20:12 +00:00
Remove old cursor setting and make it work with client-side windows
This commit is contained in:
parent
e6f2a809b2
commit
3c7a37d10d
@ -512,35 +512,6 @@ _gdk_quartz_events_update_mouse_window (GdkWindow *window)
|
||||
current_mouse_window = window;
|
||||
}
|
||||
|
||||
/* Update current cursor */
|
||||
void
|
||||
_gdk_quartz_events_update_cursor (GdkWindow *window)
|
||||
{
|
||||
GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
|
||||
NSCursor *nscursor = nil;
|
||||
|
||||
while (private)
|
||||
{
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
|
||||
nscursor = impl->nscursor;
|
||||
if (nscursor)
|
||||
break;
|
||||
|
||||
private = private->parent;
|
||||
}
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
if (!nscursor)
|
||||
nscursor = [NSCursor arrowCursor];
|
||||
|
||||
if ([NSCursor currentCursor] != nscursor)
|
||||
[nscursor set];
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
|
||||
/* Translates coordinates from an ancestor window + coords, to
|
||||
* coordinates that are relative the child window.
|
||||
*/
|
||||
|
@ -159,7 +159,6 @@ void _gdk_quartz_events_update_focus_window (GdkWindow *new_window,
|
||||
gboolean got_focus);
|
||||
GdkWindow * _gdk_quartz_events_get_mouse_window (gboolean consider_grabs);
|
||||
void _gdk_quartz_events_update_mouse_window (GdkWindow *window);
|
||||
void _gdk_quartz_events_update_cursor (GdkWindow *window);
|
||||
void _gdk_quartz_events_send_map_event (GdkWindow *window);
|
||||
GdkEventMask _gdk_quartz_events_get_current_event_mask (void);
|
||||
void _gdk_quartz_events_trigger_crossing_events(gboolean defer_to_mainloop);
|
||||
|
@ -185,9 +185,6 @@ gdk_window_impl_quartz_finalize (GObject *object)
|
||||
|
||||
check_grab_destroy (GDK_DRAWABLE_IMPL_QUARTZ (object)->wrapper);
|
||||
|
||||
if (impl->nscursor)
|
||||
[impl->nscursor release];
|
||||
|
||||
if (impl->paint_clip_region)
|
||||
gdk_region_destroy (impl->paint_clip_region);
|
||||
|
||||
@ -974,7 +971,6 @@ _gdk_quartz_window_destroy (GdkWindow *window,
|
||||
GdkWindowObject *private;
|
||||
GdkWindowImplQuartz *impl;
|
||||
GdkWindowObject *parent;
|
||||
GdkWindow *mouse_window;
|
||||
|
||||
private = GDK_WINDOW_OBJECT (window);
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
@ -994,11 +990,6 @@ _gdk_quartz_window_destroy (GdkWindow *window,
|
||||
|
||||
_gdk_quartz_drawable_finish (GDK_DRAWABLE (impl));
|
||||
|
||||
mouse_window = _gdk_quartz_events_get_mouse_window (FALSE);
|
||||
if (window == mouse_window ||
|
||||
_gdk_quartz_window_is_ancestor (window, mouse_window))
|
||||
_gdk_quartz_events_update_mouse_window (_gdk_root);
|
||||
|
||||
if (!recursing && !foreign_destroy)
|
||||
{
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
@ -1123,7 +1114,6 @@ gdk_window_quartz_hide (GdkWindow *window)
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GdkWindowImplQuartz *impl;
|
||||
GdkWindow *mouse_window;
|
||||
|
||||
/* Make sure we're not stuck in fullscreen mode. */
|
||||
if (get_fullscreen_geometry (window))
|
||||
@ -1131,11 +1121,6 @@ gdk_window_quartz_hide (GdkWindow *window)
|
||||
|
||||
check_grab_unmap (window);
|
||||
|
||||
mouse_window = _gdk_quartz_events_get_mouse_window (FALSE);
|
||||
if (window == mouse_window ||
|
||||
_gdk_quartz_window_is_ancestor (window, mouse_window))
|
||||
_gdk_quartz_events_update_mouse_window (_gdk_root);
|
||||
|
||||
_gdk_window_clear_update_area (window);
|
||||
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
@ -1567,31 +1552,20 @@ static void
|
||||
gdk_window_quartz_set_cursor (GdkWindow *window,
|
||||
GdkCursor *cursor)
|
||||
{
|
||||
GdkWindowImplQuartz *impl;
|
||||
GdkCursorPrivate *cursor_private;
|
||||
NSCursor *nscursor;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (window)->impl);
|
||||
cursor_private = (GdkCursorPrivate *)cursor;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
if (!cursor)
|
||||
nscursor = NULL;
|
||||
nscursor = [NSCursor arrowCursor];
|
||||
else
|
||||
nscursor = [cursor_private->nscursor retain];
|
||||
nscursor = cursor_private->nscursor;
|
||||
|
||||
if (impl->nscursor)
|
||||
[impl->nscursor release];
|
||||
|
||||
impl->nscursor = nscursor;
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
_gdk_quartz_events_update_cursor (_gdk_quartz_events_get_mouse_window (TRUE));
|
||||
[nscursor set];
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -51,8 +51,6 @@ struct _GdkWindowImplQuartz
|
||||
|
||||
GdkWindowTypeHint type_hint;
|
||||
|
||||
NSCursor *nscursor;
|
||||
|
||||
GdkRegion *paint_clip_region;
|
||||
gint begin_paint_count;
|
||||
gint in_paint_rect_count;
|
||||
|
Loading…
Reference in New Issue
Block a user