mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
On pointer grab request native events needed for event emulation
When we grab the pointer we need to request more events than what is specified, otherwise our event emulation stop working and you won't e.g. get crossing event unless you specified motion event mask.
This commit is contained in:
parent
f8aba14714
commit
3bcf8b39fb
@ -1184,6 +1184,23 @@ get_native_event_mask (GdkWindowObject *private)
|
||||
}
|
||||
}
|
||||
|
||||
static GdkEventMask
|
||||
get_native_grab_event_mask (GdkEventMask grab_mask)
|
||||
{
|
||||
/* Similar to the above but for pointer events only */
|
||||
return
|
||||
GDK_POINTER_MOTION_MASK |
|
||||
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
|
||||
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
|
||||
GDK_SCROLL_MASK |
|
||||
(grab_mask &
|
||||
~(GDK_POINTER_MOTION_HINT_MASK |
|
||||
GDK_BUTTON_MOTION_MASK |
|
||||
GDK_BUTTON1_MOTION_MASK |
|
||||
GDK_BUTTON2_MOTION_MASK |
|
||||
GDK_BUTTON3_MOTION_MASK));
|
||||
}
|
||||
|
||||
/* Puts the native window in the right order wrt the other native windows
|
||||
* in the hierarchy, given the position it has in the client side data.
|
||||
* This is useful if some operation changed the stacking order.
|
||||
@ -9564,7 +9581,7 @@ gdk_pointer_grab (GdkWindow * window,
|
||||
res = _gdk_windowing_pointer_grab (window,
|
||||
native,
|
||||
owner_events,
|
||||
event_mask,
|
||||
get_native_grab_event_mask (event_mask),
|
||||
confine_to,
|
||||
cursor,
|
||||
time);
|
||||
|
Loading…
Reference in New Issue
Block a user