Commit 025b6aa7 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson
Browse files

Report the steady state in gdk_display_pointer_is_grabbed

For instance if we grab the pointer and then check if its grabbed
so that we know to ungrab we don't care that the grab is not
yet active, so report the steady state (i.e. the last grab)
parent 5be3f385
......@@ -750,24 +750,6 @@ generate_grab_broken_event (GdkWindow *window,
}
}
/* Get the pointer grab in effects for events we just sent */
GdkPointerGrabInfo *
_gdk_display_get_active_pointer_grab (GdkDisplay *display)
{
GdkPointerGrabInfo *info;
if (display->pointer_grabs == NULL)
return NULL;
info = display->pointer_grabs->data;
if (info->activated)
return info;
return NULL;
}
GdkPointerGrabInfo *
_gdk_display_get_last_pointer_grab (GdkDisplay *display)
{
......@@ -1266,7 +1248,10 @@ gdk_pointer_grab_info_libgtk_only (GdkDisplay *display,
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
info = _gdk_display_get_active_pointer_grab (display);
/* What we're interested in is the steady state (ie last grab),
because we're interested e.g. if we grabbed so that we
can ungrab, even if our grab is not active just yet. */
info = _gdk_display_get_last_pointer_grab (display);
if (info)
{
......@@ -1299,7 +1284,10 @@ gdk_display_pointer_is_grabbed (GdkDisplay *display)
g_return_val_if_fail (GDK_IS_DISPLAY (display), TRUE);
info = _gdk_display_get_active_pointer_grab (display);
/* What we're interested in is the steady state (ie last grab),
because we're interested e.g. if we grabbed so that we
can ungrab, even if our grab is not active just yet. */
info = _gdk_display_get_last_pointer_grab (display);
return (info && !info->implicit);
}
......
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