From 4508978ea52336ee41ec2ec4e1de6fe8209d862b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 15 Nov 2017 16:04:33 +0800 Subject: [PATCH] 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 --- src/wayland/meta-wayland-xdg-shell.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index 8bb2ec787..6d9a0d5cc 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -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;