diff options
author | Michel Dänzer <mdaenzer@redhat.com> | 2022-11-01 16:52:41 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2022-12-01 12:41:32 +0100 |
commit | 6c3879766decb27c1e1f09845daff0a307494ed0 (patch) | |
tree | 65c0e8f4ea2e100da97cc4567db6396663e441b9 | |
parent | 26346a06eee6808f0005ea97fbe40230a7f8e5d3 (diff) | |
download | mutter-6c3879766decb27c1e1f09845daff0a307494ed0.tar.gz |
wayland/xdg-shell: Add parent surface entry to popup setup transaction
This makes sure that finish_popup_setup is called after any previous
transactions for the parent surface have been applied, so the parent
window geometry is up to date.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1880>
-rw-r--r-- | src/wayland/meta-wayland-xdg-shell.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index bb68e5ecb..1c2877d3c 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -34,6 +34,7 @@ #include "wayland/meta-wayland-seat.h" #include "wayland/meta-wayland-shell-surface.h" #include "wayland/meta-wayland-surface.h" +#include "wayland/meta-wayland-transaction.h" #include "wayland/meta-wayland-versions.h" #include "wayland/meta-wayland-window-configuration.h" #include "wayland/meta-wayland.h" @@ -1188,6 +1189,20 @@ dismiss_invalid_popup (MetaWaylandXdgPopup *xdg_popup) } static void +meta_wayland_xdg_popup_commit_state (MetaWaylandSurfaceRole *surface_role, + MetaWaylandTransaction *transaction, + MetaWaylandSurfaceState *pending) +{ + MetaWaylandXdgPopup *xdg_popup = META_WAYLAND_XDG_POPUP (surface_role); + + if (xdg_popup->setup.parent_surface) + { + meta_wayland_transaction_ensure_entry (transaction, + xdg_popup->setup.parent_surface); + } +} + +static void meta_wayland_xdg_popup_apply_state (MetaWaylandSurfaceRole *surface_role, MetaWaylandSurfaceState *pending) { @@ -1447,6 +1462,7 @@ meta_wayland_xdg_popup_class_init (MetaWaylandXdgPopupClass *klass) object_class->finalize = meta_wayland_xdg_popup_finalize; surface_role_class = META_WAYLAND_SURFACE_ROLE_CLASS (klass); + surface_role_class->commit_state = meta_wayland_xdg_popup_commit_state; surface_role_class->apply_state = meta_wayland_xdg_popup_apply_state; surface_role_class->post_apply_state = meta_wayland_xdg_popup_post_apply_state; surface_role_class->get_toplevel = meta_wayland_xdg_popup_get_toplevel; |