[RFC] attempt at solving #3616

- Untested
- Can't reproduce issues, so not sure it fixes it either
This commit is contained in:
Johan Malm 2026-06-04 20:45:14 +01:00
parent 579e532908
commit 922c4bba2b
4 changed files with 5 additions and 5 deletions

View file

@ -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);

View file

@ -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);
}
}
}

View file

@ -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;

View file

@ -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