summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman@collabora.com>2023-01-31 16:47:48 -0600
committerMarius Vlad <marius.vlad@collabora.com>2023-02-03 11:02:51 +0200
commit9d24fb96fb7c67698b069e93920dc2edef15a829 (patch)
treef9064c03f851537b38b2565470fb6fc2799a5c07
parent3560da1255cf139d24d53a256fa6754770addfdb (diff)
downloadweston-9d24fb96fb7c67698b069e93920dc2edef15a829.tar.gz
xwm: Be careful with window size when minimizing
If we're minimized from maximized or fullscreen state, we want to leave the saved size alone, so we can restore it if we clear fullscreen or maximized state later. Signed-off-by: Hideyuki Nagase <hideyukn@microsoft.com>
-rw-r--r--xwayland/window-manager.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 71483ea7..d2d66c7f 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -1927,8 +1927,14 @@ weston_wm_window_handle_iconic_state(struct weston_wm_window *window,
iconic_state = client_message->data.data32[0];
if (iconic_state == ICCCM_ICONIC_STATE) {
- window->saved_height = window->height;
- window->saved_width = window->width;
+ /* If window is currently in maximized or fullscreen state,
+ * don't override saved size.
+ */
+ if (!weston_wm_window_is_maximized(window) &&
+ !window->fullscreen) {
+ window->saved_height = window->height;
+ window->saved_width = window->width;
+ }
xwayland_interface->set_minimized(window->shsurf);
}
}
@@ -2297,8 +2303,14 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event)
}
if (frame_status(window->frame) & FRAME_STATUS_MINIMIZE) {
- window->saved_width = window->width;
- window->saved_height = window->height;
+ /* If window is currently in maximized or fullscreen state,
+ * don't override saved size.
+ */
+ if (!weston_wm_window_is_maximized(window) &&
+ !window->fullscreen) {
+ window->saved_width = window->width;
+ window->saved_height = window->height;
+ }
xwayland_interface->set_minimized(window->shsurf);
frame_status_clear(window->frame, FRAME_STATUS_MINIMIZE);
}