summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-09-07 17:51:23 +0200
committerJonas Ådahl <jadahl@gmail.com>2020-09-07 17:57:32 +0200
commita184b5bf51a17016cfed26d44d959642352fbb26 (patch)
tree1aa8c33b42ae1fa6ebf228a474c7c7c49758a7d0
parent3d273cc0738a508dd636daf65a9f01991377dac5 (diff)
downloadgtk+-a184b5bf51a17016cfed26d44d959642352fbb26.tar.gz
wayland: Emit dummy configure event when resizing while fixed
When a fixed size is active (e.g. the window is maximized), gtk_window_resize() shouldn't take immediate effect, so the request was dropped. This made GTK unhappy if this happened, it will freeze updating the window until it received the new size it demanded. Handle this by being nice and emitting a dummy GDK_CONFIGURE event with the old size where we previously ignored it. It won't resize the window immediately, so it shouldn't have a visible effect, and the size GTK requested is still saved away for when the window is unmaximized, but emitting the event will make GTK receive the event it expects. We still drop the request on the floor, e.g. if we still haven't seen the initial configuration, just as we do when actually doing the resize. Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2907
-rw-r--r--gdk/wayland/gdkwindow-wayland.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index c91b882c9d..045368797d 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -3495,7 +3495,19 @@ gdk_window_wayland_move_resize (GdkWindow *window,
if (!should_use_fixed_size (window->state) ||
(width == impl->fixed_size_width &&
height == impl->fixed_size_height))
- gdk_wayland_window_maybe_configure (window, width, height, impl->scale);
+ {
+ gdk_wayland_window_maybe_configure (window,
+ width,
+ height,
+ impl->scale);
+ }
+ else if (!should_inhibit_resize (window))
+ {
+ gdk_wayland_window_configure (window,
+ window->width,
+ window->height,
+ impl->scale);
+ }
}
}