diff --git a/include/view.h b/include/view.h index 46943ab2..f747e309 100644 --- a/include/view.h +++ b/include/view.h @@ -579,7 +579,7 @@ void view_toggle_fullscreen(struct view *view); */ void view_save_last_placement(struct view *view); /* Restores and adjusts the view's position from the view->last_placement */ -void view_adjust_for_layout_change(struct view *view); +void view_adjust_for_layout_change(struct view *view, bool force); void view_move_to_edge(struct view *view, enum lab_edge direction, bool snap_to_windows); void view_grow_to_edge(struct view *view, enum lab_edge direction); diff --git a/src/desktop.c b/src/desktop.c index 57ef9e3c..9ef975a8 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -40,7 +40,7 @@ desktop_arrange_all_views(void) struct view *view; wl_list_for_each(view, &server.views, link) { if (!wlr_box_empty(&view->pending)) { - view_adjust_for_layout_change(view); + view_adjust_for_layout_change(view, /* force */ false); } } } diff --git a/src/view.c b/src/view.c index 21005f20..af670317 100644 --- a/src/view.c +++ b/src/view.c @@ -1754,10 +1754,10 @@ clear_last_placement(struct view *view) } void -view_adjust_for_layout_change(struct view *view) +view_adjust_for_layout_change(struct view *view, bool force) { assert(view); - if (wlr_box_empty(&view->last_placement.layout_geo)) { + if (wlr_box_empty(&view->last_placement.layout_geo) && !force) { /* Not using assert() just in case */ wlr_log(WLR_ERROR, "view has no last placement info"); return; diff --git a/src/xwayland.c b/src/xwayland.c index 5838d412..542fc544 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -800,7 +800,7 @@ handle_map(struct wl_listener *listener, void *data) * layout changes that could have occurred between * ensure_initial_geometry_and_output() and map. */ - view_adjust_for_layout_change(view); + view_adjust_for_layout_change(view, /* force */ true); /* * When mapping the view for the first time, visual * artifacts are reduced if we display it immediately at