summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorLeandro Ribeiro <leandro.ribeiro@collabora.com>2023-02-06 15:55:18 -0300
committerPekka Paalanen <pq@iki.fi>2023-02-07 09:59:16 +0000
commitba82af938a87ff088b4aacff3b8ac1b6bb461be2 (patch)
tree0bc1bdc2f221a6f7e7b8c6e721555c1b9982464c /desktop-shell
parent7c1492216ede419f6641c4267de6f73fbf4e6e03 (diff)
downloadweston-ba82af938a87ff088b4aacff3b8ac1b6bb461be2.tar.gz
desktop-shell: do not forget to reset pending config size after resizes
During interactive resizes, we progressively change the size of the client surface and send config events with these sizes to the client. After that, the toplevel->pending.size keeps the size of the last config event that we've sent, i.e. the surface size after the resize is over. Later, if the client spontaneously resize (by attaching a buffer with a different size or setting the viewport destination, for instance), their surface size will change, but toplevel->pending.size continues being that old size from after the resize. If something happens and Weston decides to send a config event, clients may re-allocate to that old size, resulting in a sudden resize. This does not happen when a client goes from fullscreen/maximized to windowed mode because in such cases we are resetting toplevel->pending.size to zero. So in the next config event that clients receive they are allowed to attach buffers with the size that they prefer. So do the same after a resize: set the pending config size to zero. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/shell.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 716223ad..511b2cc5 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1219,6 +1219,7 @@ resize_grab_button(struct weston_pointer_grab *grab,
resize->base.shsurf->desktop_surface;
weston_desktop_surface_set_resizing(desktop_surface,
false);
+ weston_desktop_surface_set_size(desktop_surface, 0, 0);
}
shell_grab_end(&resize->base);
@@ -1235,6 +1236,7 @@ resize_grab_cancel(struct weston_pointer_grab *grab)
struct weston_desktop_surface *desktop_surface =
resize->base.shsurf->desktop_surface;
weston_desktop_surface_set_resizing(desktop_surface, false);
+ weston_desktop_surface_set_size(desktop_surface, 0, 0);
}
shell_grab_end(&resize->base);