output: Add output_nearest_to()

Reimplement output_from_cursor_coords() as output_nearest_to_cursor().
This commit is contained in:
John Lindgren 2023-02-03 15:22:54 -05:00 committed by Consolatis
parent 84294c9cfb
commit 976136299d
5 changed files with 25 additions and 22 deletions

View file

@ -276,8 +276,7 @@ position_xdg_toplevel_view(struct view *view)
xdg_toplevel_from_view(view)->parent;
if (!parent_xdg_toplevel) {
view_center(view, output_from_cursor_coords(view->server),
NULL);
view_center(view, output_nearest_to_cursor(view->server), NULL);
} else {
/*
* If child-toplevel-views, we center-align relative to their