view: factor out view_compute_position_by_policy()

This commit is contained in:
John Lindgren 2026-02-21 15:06:02 -05:00 committed by Hiroaki Yamamoto
parent 6a9e6dcae1
commit 5238dcaa08
2 changed files with 27 additions and 20 deletions

View file

@ -514,6 +514,14 @@ int view_effective_height(struct view *view, bool use_pending);
*/
void view_center(struct view *view, const struct wlr_box *ref);
/*
* Like view_place_by_policy() but doesn't actually move the view.
* Returns false if position could not be computed (for example, if no
* outputs are connected). In that case, @geom is not modified.
*/
bool view_compute_position_by_policy(struct view *view, struct wlr_box *geom,
bool allow_cursor, enum lab_placement_policy policy);
/**
* view_place_by_policy - apply placement strategy to view
* @view: view to be placed