From 6cf7d2d47fb0263cd056f91bfc96020af95b1b4b Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 21 Jun 2017 11:33:18 +0200 Subject: [PATCH] wayland: Do not enforce a size on un-maximize When un-maximizing, use a zero size to pass to the client so that it can use the right un-maximized size that fits. https://bugzilla.gnome.org/show_bug.cgi?id=783901 --- src/wayland/meta-window-wayland.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c index d5d8e21b0..5e451ca58 100644 --- a/src/wayland/meta-window-wayland.c +++ b/src/wayland/meta-window-wayland.c @@ -210,8 +210,17 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, * coordinate space so that we can have a scale independent size to pass * to the Wayland surface. */ geometry_scale = meta_window_wayland_get_geometry_scale (window); - configured_width = constrained_rect.width / geometry_scale; - configured_height = constrained_rect.height / geometry_scale; + if (flags & META_MOVE_RESIZE_UNMAXIMIZE) + { + /* On un-maximize, let the client decide on its size */ + configured_width = 0; + configured_height = 0; + } + else + { + configured_width = constrained_rect.width / geometry_scale; + configured_height = constrained_rect.height / geometry_scale; + } /* For wayland clients, the size is completely determined by the client, * and while this allows to avoid some trickery with frames and the resulting