wayland/xdg-shell: Dismiss instead of destroy invalid popup

Destroying is insufficient as it doesn't end any popup pointer grab, if
the dismissed popup was the last. This would later hit an assert as the
popup grab is assumed to always have at least one popup in its chain.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2728
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2940>
This commit is contained in:
Jonas Ådahl 2023-03-27 21:43:33 +02:00
parent 697b99ee13
commit 50a37a7fc0

View File

@ -1195,7 +1195,7 @@ dismiss_invalid_popup (MetaWaylandXdgPopup *xdg_popup)
top_xdg_popup = meta_wayland_xdg_popup_from_surface (top_popup_surface);
xdg_popup_send_popup_done (top_xdg_popup->resource);
meta_wayland_popup_destroy (top_xdg_popup->popup);
meta_wayland_popup_dismiss (top_xdg_popup->popup);
if (top_xdg_popup == xdg_popup)
break;