diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2014-03-12 12:39:03 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-03-12 23:03:53 -0400 |
commit | 40b6d907bf0e22fbb5cbb0ff91cada8f3264fc28 (patch) | |
tree | 929e98b244af1e9267d6c2d4963638235ee6d8e6 /gdk/gdkdevice.c | |
parent | 4ce5fcc5c853bea5acc9ddf61b4426781761fbf5 (diff) | |
download | gtk+-40b6d907bf0e22fbb5cbb0ff91cada8f3264fc28.tar.gz |
Use GDK's current window tracking when synthesizing events in GTK+
Add gdk_device_get_last_event_window(), and use to implement the window
tracking we need for synthesizing crossing events for sensitivity changes
and gtk grabs, rather than keeping the information in qdata and updating
it based when GTK+ gets events.
https://bugzilla.gnome.org/show_bug.cgi?id=726187
Diffstat (limited to 'gdk/gdkdevice.c')
-rw-r--r-- | gdk/gdkdevice.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c index 9508a7be13..24499d7965 100644 --- a/gdk/gdkdevice.c +++ b/gdk/gdkdevice.c @@ -1717,3 +1717,30 @@ _gdk_device_window_at_position (GdkDevice *device, mask, get_toplevel); } + +/** + * gdk_device_get_last_event_window: + * @device: a #GdkDevice, with a source other than %GDK_SOURCE_KEYBOARD + * + * Gets information about which window the given pointer device is in, based on + * that have been received so far from the display server. If another application + * has a pointer grab, or this application has a grab with owner_events = %FALSE, + * %NULL may be returned even if the pointer is physically over one of this + * application's windows. + * + * Returns: (transfer none) (allow-none): the last window the device + */ +GdkWindow * +gdk_device_get_last_event_window (GdkDevice *device) +{ + GdkDisplay *display; + GdkPointerWindowInfo *info; + + g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); + g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL); + + display = gdk_device_get_display (device); + info = _gdk_display_get_pointer_info (display, device); + + return info->window_under_pointer; +} |