From: tokyo4j Date: Mon, 1 Sep 2025 08:52:06 +0000 (+0900) Subject: view: restore initially-maximized window position after unplug/plug X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=72a5df16ea6ca713133d465c559b8e1ec7a1779c;p=proto%2Flabwc.git view: restore initially-maximized window position after unplug/plug `update_last_layout_geometry()` stores `view->natural_geometry` in `view->last_layout_geometry`, but it's empty for initially-maximized windows, so their positions were not restored after outputs are unplugged and plugged (also when VT switching in wlroots 0.19.0). This commit sets the fallback natural geometry (at the center of the output) so that initially-maximized windows reappears in the same output. --- diff --git a/src/view.c b/src/view.c index f48169fa..54eb6039 100644 --- a/src/view.c +++ b/src/view.c @@ -1806,8 +1806,12 @@ update_last_layout_geometry(struct view *view) if (view_is_floating(view)) { view->last_layout_geometry = view->pending; - } else { + } else if (!wlr_box_empty(&view->natural_geometry)) { view->last_layout_geometry = view->natural_geometry; + } else { + /* e.g. initially-maximized window */ + view->last_layout_geometry = + view_get_fallback_natural_geometry(view); } }