view: Add optional output parameter to view_center()

Allows centering the view on a specific output without the workaround of
overwriting view->current.x/y.
This commit is contained in:
John Lindgren 2023-02-18 00:23:19 -05:00
parent df7c47b8d7
commit 5062c5bea3
6 changed files with 22 additions and 30 deletions

View file

@ -518,14 +518,13 @@ output_usable_area_in_layout_coords(struct output *output)
return box;
}
struct wlr_box
output_usable_area_from_cursor_coords(struct server *server)
struct output *
output_from_cursor_coords(struct server *server)
{
struct wlr_output *wlr_output;
wlr_output = wlr_output_layout_output_at(server->output_layout,
server->seat.cursor->x, server->seat.cursor->y);
struct output *output = output_from_wlr_output(server, wlr_output);
return output_usable_area_in_layout_coords(output);
return output_from_wlr_output(server, wlr_output);
}
void