xdg: Use view_center() for parent-relative centering

- Add optional struct wlr_box* ref argument to view_center()
- Perform margin adjustment within view_center()
- Expose view_output() to fetch parent's output
This commit is contained in:
John Lindgren 2023-02-19 12:42:21 -05:00
parent 612c296d52
commit 74bc16910a
4 changed files with 26 additions and 32 deletions

View file

@ -440,7 +440,8 @@ set_initial_position(struct view *view,
/* Just make sure the view is on-screen */
view_adjust_for_layout_change(view);
} else {
view_center(view, output_from_cursor_coords(view->server));
view_center(view, output_from_cursor_coords(view->server),
NULL);
}
}