This commit is contained in:
Johan Malm 2026-06-09 14:05:33 +09:00 committed by GitHub
commit bf8a9e3857
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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); void view_save_last_placement(struct view *view);
/* Restores and adjusts the view's position from the view->last_placement */ /* 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_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); 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; struct view *view;
wl_list_for_each(view, &server.views, link) { wl_list_for_each(view, &server.views, link) {
if (!wlr_box_empty(&view->pending)) { 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 void
view_adjust_for_layout_change(struct view *view) view_adjust_for_layout_change(struct view *view, bool force)
{ {
assert(view); 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 */ /* Not using assert() just in case */
wlr_log(WLR_ERROR, "view has no last placement info"); wlr_log(WLR_ERROR, "view has no last placement info");
return; return;

View file

@ -800,7 +800,7 @@ handle_map(struct wl_listener *listener, void *data)
* layout changes that could have occurred between * layout changes that could have occurred between
* ensure_initial_geometry_and_output() and map. * 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 * When mapping the view for the first time, visual
* artifacts are reduced if we display it immediately at * artifacts are reduced if we display it immediately at