mirror of
https://github.com/labwc/labwc.git
synced 2026-02-16 22:05:27 -05:00
output: Add output_nearest_to()
Reimplement output_from_cursor_coords() as output_nearest_to_cursor().
This commit is contained in:
parent
84294c9cfb
commit
976136299d
5 changed files with 25 additions and 22 deletions
10
src/view.c
10
src/view.c
|
|
@ -226,15 +226,9 @@ struct output *
|
|||
view_output(struct view *view)
|
||||
{
|
||||
assert(view);
|
||||
double closest_x, closest_y;
|
||||
struct wlr_output *wlr_output = NULL;
|
||||
wlr_output_layout_closest_point(view->server->output_layout, wlr_output,
|
||||
return output_nearest_to(view->server,
|
||||
view->current.x + view->current.width / 2,
|
||||
view->current.y + view->current.height / 2,
|
||||
&closest_x, &closest_y);
|
||||
wlr_output = wlr_output_layout_output_at(view->server->output_layout,
|
||||
closest_x, closest_y);
|
||||
return output_from_wlr_output(view->server, wlr_output);
|
||||
view->current.y + view->current.height / 2);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue