gdk/wayland: Ensure .leave events with active buttons breaks grabs

Instead of silently ending up the grab, make it sure that we emit
a GDK_GRAB_BROKEN event if needed.
This commit is contained in:
Carlos Garnacho 2020-05-12 10:21:35 +02:00
parent 2bd8124b5d
commit f7d2985f89

View File

@ -706,7 +706,6 @@ device_maybe_emit_ungrab_crossing (GdkDevice *device,
if (grab)
{
grab->serial_end = grab->serial_start;
prev_focus = grab->surface;
surface = grab->surface;
}
@ -1541,6 +1540,19 @@ pointer_handle_leave (void *data,
_gdk_wayland_display_update_serial (display_wayland, serial);
if (seat->pointer_info.button_modifiers != 0)
{
gulong display_serial;
display_serial = _gdk_display_get_next_serial (seat->display);
_gdk_display_end_device_grab (seat->display, seat->master_pointer,
display_serial, NULL, TRUE);
_gdk_display_device_grab_update (seat->display,
seat->master_pointer,
seat->pointer,
display_serial);
}
event = gdk_crossing_event_new (GDK_LEAVE_NOTIFY,
seat->pointer_info.focus,
seat->master_pointer,