wayland/xdg-shell: Dismiss a popup on map if parent already dismissed

If a parent doesn't have a window, it means it could have been
dismissed (for example due to a input serial race), but the more recent
popup might win the input serial race and try to map anyway. This would
result in a crash later on when trying to process the placement rule,
as the parent already has no window.

https://bugzilla.gnome.org/show_bug.cgi?id=790358
This commit is contained in:
Jonas Ådahl 2017-11-15 16:04:33 +08:00
parent c533a06e93
commit 4508978ea5

View File

@ -798,6 +798,12 @@ finish_popup_setup (MetaWaylandXdgPopup *xdg_popup)
xdg_popup->setup.parent_surface = NULL;
xdg_popup->setup.grab_seat = NULL;
if (!parent_surface->window)
{
zxdg_popup_v6_send_popup_done (xdg_popup->resource);
return;
}
if (seat)
{
MetaWaylandSurface *top_popup;