From e7251a759bb943b18fffdfecda0c5c33f27f8ba8 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 2 Dec 2022 09:12:11 -0600 Subject: [PATCH] xwm: Preserve unmaximized window size at map time This fixes a problem that can be seen with Firefox running under xwayland. - Start it (or another client that remembers its size and maximized state), - resize it - maximize it - exit it - restart it - unmaximize it The size will be changed to a default size and not the previous unmaximized size. To fix this, save the unmaximized height and width like we do for the fullscreen case. Co-authored-by: Steve Pronovost Co-authored-by: Brenton DeGeer Signed-off-by: Hideyuki Nagase Signed-off-by: Steve Pronovost Signed-off-by: Brenton DeGeer Signed-off-by: Derek Foreman --- xwayland/window-manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index d90e84b7d..71483ea74 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -3035,6 +3035,8 @@ xserver_map_shell_surface(struct weston_wm_window *window, parent->surface); } } else if (weston_wm_window_is_maximized(window)) { + window->saved_width = window->width; + window->saved_height = window->height; xwayland_interface->set_maximized(window->shsurf); } else { if (weston_wm_window_type_inactive(window)) {