summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2023-03-27 21:27:44 +0200
committerJonas Ådahl <jadahl@gmail.com>2023-03-27 21:27:44 +0200
commitc88f2caa044d99bb6ffcd2161fac1dfddba71066 (patch)
tree5b008a3fd1a4c8fe6475b0f35a0e1653ef4ff7ec /gdk
parent506206e1bd743de333f543782f5f37c2646dcc7a (diff)
downloadgtk+-c88f2caa044d99bb6ffcd2161fac1dfddba71066.tar.gz
wayland/popup: Handle late received reposition feedback
If we map, reposition, unmap, remap, the reposition feedback from the last time a popup was mapped might be received while we're dealing with the new version of the popup. At this point, the old reposition token has no meating, so lets drop it. Also reset the reposition tokens when creating new protocol objects, so that the reposition token are as if we're in the initial state. This fixes an issue where we'd get stuck if repeatedly smashing a button that'd create popups that'd immediately get dismissed by the compositor.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/wayland/gdkpopup-wayland.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdk/wayland/gdkpopup-wayland.c b/gdk/wayland/gdkpopup-wayland.c
index a79670aef2..38a498eb4f 100644
--- a/gdk/wayland/gdkpopup-wayland.c
+++ b/gdk/wayland/gdkpopup-wayland.c
@@ -398,7 +398,11 @@ gdk_wayland_popup_handle_configure (GdkWaylandSurface *wayland_surface)
g_warn_if_reached ();
if (wayland_popup->pending.has_repositioned_token)
- wayland_popup->received_reposition_token = wayland_popup->pending.repositioned_token;
+ {
+ wayland_popup->received_reposition_token =
+ wayland_popup->pending.repositioned_token;
+ wayland_popup->pending.has_repositioned_token = FALSE;
+ }
switch (wayland_popup->state)
{
@@ -968,6 +972,9 @@ gdk_wayland_surface_create_xdg_popup (GdkWaylandPopup *wayland_popup,
g_assert_not_reached ();
}
+ wayland_popup->received_reposition_token = 0;
+ wayland_popup->reposition_token = 0;
+
gdk_popup_layout_get_shadow_width (layout,
&impl->shadow_left,
&impl->shadow_right,