From 40e76fe19da9390b3ca1549f4b378865bb20228f Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 6 Jun 2022 13:25:27 -0500 Subject: [PATCH] xwayland: Set non zero default saved window size If a client starts off maximized, clicking the unmaximize button would result in a 0x0 window - basically a blob of decor with no content. Instead, use 512x512 as a totally random default value. Signed-off-by: Derek Foreman --- xwayland/window-manager.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index f5b61c42..41dddd23 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -1509,6 +1509,12 @@ weston_wm_window_create(struct weston_wm *wm, window->override_redirect = override; window->width = width; window->height = height; + /* Completely arbitrary defaults in case something starts + * maximized and we unmaximize it later - at which point 0 x 0 + * would not be the most useful size. + */ + window->saved_width = 512; + window->saved_height = 512; window->x = x; window->y = y; window->pos_dirty = false;