wayland/xdg-shell: Bail from popup_configure if resource was destroyed

This function gets called when a surface state transaction is applied.
Applying a transaction can get delayed, so the Wayland resource may have
already been destroyed when we get here. In that case we cannot send
events, so there's nothing to do.

v2:
* Drop code comment, expand commit log instead. (Jonas Ådahl)

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2737
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2967>
This commit is contained in:
Michel Dänzer 2023-04-17 18:35:09 +02:00 committed by Marge Bot
parent 867494d3df
commit db24557e40

View File

@ -1364,6 +1364,9 @@ meta_wayland_xdg_popup_configure (MetaWaylandShellSurface *shell_surface,
int geometry_scale; int geometry_scale;
int x, y; int x, y;
if (!xdg_popup->resource)
return;
/* If the parent surface was destroyed, its window will be destroyed /* If the parent surface was destroyed, its window will be destroyed
* before the popup receives the parent-destroy signal. This means that * before the popup receives the parent-destroy signal. This means that
* the popup may potentially get temporary focus until itself is destroyed. * the popup may potentially get temporary focus until itself is destroyed.