output-layout: improve closest point for no outputs case

Without outputs, all points are equally invalid anyway, but for e.g.
cursor warping it makes more sense to preserve the original position.
This commit is contained in:
Kirill Primak 2023-01-21 14:02:27 +03:00 committed by Simon Ser
parent 377668aaf6
commit 843b874f22
2 changed files with 2 additions and 1 deletions

View file

@ -302,7 +302,7 @@ void wlr_output_layout_closest_point(struct wlr_output_layout *layout,
return;
}
double min_x = 0, min_y = 0, min_distance = DBL_MAX;
double min_x = lx, min_y = ly, min_distance = DBL_MAX;
struct wlr_output_layout_output *l_output;
wl_list_for_each(l_output, &layout->outputs, link) {
if (reference != NULL && reference != l_output->output) {