diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2023-03-28 23:07:54 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2023-04-13 21:02:08 +0200 |
commit | 47b6e76578edc34ca1a8526d5c067eea1591a9aa (patch) | |
tree | 0fa3b47f804d5724114b0d7017407455236e726a | |
parent | 50a37a7fc087e17f50004071af7603afc98a465c (diff) | |
download | mutter-47b6e76578edc34ca1a8526d5c067eea1591a9aa.tar.gz |
xdg-shell: Early out of apply if dismissed
We might end up trying to apply a pending state late if it was delayed
by DMA buffers not being ready. Trying to discard the pending state from
the transaction when dismissing is hard, because we might be applying a
chain of transactions that would disqualify subsequent transactions if a
former one dismisses the popup, so lets just drop what the apply would
otherwise do, if we're not going to use it anyway.
This fixes the following crash:
0) meta_wayland_surface_get_window (surface=0x0)
1) meta_wayland_xdg_popup_apply_state (surface_role=0xf5ee80, pending=0xf662a0)
2) meta_wayland_surface_role_apply_state (surface_role=0xf5ee80, pending=0xf662a0)
3) meta_wayland_surface_apply_state (surface=0xf5e640, state=0xf662a0)
4) meta_wayland_transaction_apply (transaction=0xf56170, first_candidate=0x7fffffffcee8)
5) meta_wayland_transaction_maybe_apply_one (transaction=0xf56170, first_candidate=0x7fffffffcee8)
6) meta_wayland_transaction_maybe_apply (transaction=0xf56170)
7) meta_wayland_transaction_dma_buf_dispatch (buffer=0xf448a0, user_data=0xf56200)
8) meta_wayland_dma_buf_source_dispatch (base=0xf5f140, callback=0x0, user_data=0x0)
9) g_main_dispatch (context=0x41baa0)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2940>
-rw-r--r-- | src/wayland/meta-wayland-xdg-shell.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index 547f93222..b0ce310d2 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -1239,6 +1239,9 @@ meta_wayland_xdg_popup_apply_state (MetaWaylandSurfaceRole *surface_role, if (xdg_popup->setup.parent_surface) finish_popup_setup (xdg_popup); + if (!meta_wayland_surface_get_window (surface)) + return; + if (pending->xdg_positioner) { MetaWindow *window, *parent_window; |