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



commit 4508978ea52336ee41ec2ec4e1de6fe8209d862b
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Nov 15 16:04:33 2017 +0800

    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 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index 8bb2ec7..6d9a0d5 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]