From a991691eeeb009c14897674afe5117c1ed77c581 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 24 Mar 2023 16:57:19 +0200 Subject: [PATCH] desktop-shell: Do not attempt to change the state Upon connector reconnect/disconnect we seem to ignore any kind of window state we might have previously to disconnect so this takes that into account and avoids a change in the state in case we detect one set-up previously. Fixes: #731 Signed-off-by: Marius Vlad --- desktop-shell/shell.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 23d537dc..e695008a 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -4652,6 +4652,10 @@ shell_reposition_view_on_output_change(struct weston_view *view) } } + shsurf = get_shell_surface(view->surface); + if (!shsurf) + return; + if (!visible) { first_output = container_of(ec->output_list.next, struct weston_output, link); @@ -4662,13 +4666,13 @@ shell_reposition_view_on_output_change(struct weston_view *view) weston_view_set_position(view, x, y); } else { weston_view_geometry_dirty(view); + + if (shsurf->state.maximized || + shsurf->state.fullscreen) + return; } - shsurf = get_shell_surface(view->surface); - if (!shsurf) - return; - shsurf->saved_position_valid = false; set_maximized(shsurf, false); set_fullscreen(shsurf, false, NULL);