MetaWaylandPopup: Dismiss popup when grab is cancelled

Dismiss the popup when the grab is cancelled, so that if the grab is
ended for whatever reason (such as VT switching or the last pointer
being disconnected), it doesn't try to end the grab when it isn't
active.

This fixes a crash when VT switching back and forth while a popup grab
is active.

https://bugzilla.gnome.org/show_bug.cgi?id=771858
This commit is contained in:
Jonas Ådahl 2016-09-21 14:45:51 +08:00
parent 6e7057426e
commit 9de6de5802

View File

@ -141,10 +141,17 @@ popup_grab_button (MetaWaylandPointerGrab *grab,
meta_wayland_pointer_end_popup_grab (grab->pointer);
}
static void
popup_grab_cancel (MetaWaylandPointerGrab *grab)
{
meta_wayland_pointer_end_popup_grab (grab->pointer);
}
static MetaWaylandPointerGrabInterface popup_grab_interface = {
popup_grab_focus,
popup_grab_motion,
popup_grab_button
popup_grab_button,
popup_grab_cancel
};
MetaWaylandPopupGrab *