summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2021-09-02 09:58:52 +0200
committerJonas Ådahl <jadahl@gmail.com>2021-09-02 10:24:38 +0200
commitd74b01636b6d4dfbf4acd6a9907fdf2c0e37dbfb (patch)
treed0854c8c0c27a30f3adddb408d44715e2ce06e8d
parent9ff2a9ab9bbf0bf6de3f66451b88c7dddce29041 (diff)
downloadgtk+-d74b01636b6d4dfbf4acd6a9907fdf2c0e37dbfb.tar.gz
window/wayland: Reset position when hiding popup
When a popup is remapped, if the GdkWindow::x/y position is negative, some best-effort hueristics used to ignore internal X11-style hackery windows incorrectly scooped up remapped popup windows. Avoid these hueristics by resetting the x and y fields of GdkWindow to 0 whe hiding a popup. It'll then appear as if it was newly initialized, and escape the mentioned hueristics. Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4071
-rw-r--r--gdk/wayland/gdkwindow-wayland.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 2d7c42bd7a..2064fbb38f 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -3330,6 +3330,12 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
impl->display_server.xdg_popup = NULL;
display_wayland->current_popups =
g_list_remove (display_wayland->current_popups, window);
+
+ if (impl->position_method == POSITION_METHOD_MOVE_TO_RECT)
+ {
+ window->x = 0;
+ window->y = 0;
+ }
}
if (impl->display_server.xdg_surface)
{
@@ -3352,6 +3358,12 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
impl->display_server.zxdg_popup_v6 = NULL;
display_wayland->current_popups =
g_list_remove (display_wayland->current_popups, window);
+
+ if (impl->position_method == POSITION_METHOD_MOVE_TO_RECT)
+ {
+ window->x = 0;
+ window->y = 0;
+ }
}
if (impl->display_server.zxdg_surface_v6)
{