mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-25 16:42:26 +00:00
output-layout: improve wlr_output_layout_output_in_direction()
Now the function checks if the reference output belongs to the layout, and returns NULL if it doesn't.
This commit is contained in:
parent
2ea80eb115
commit
26e1812ab3
@ -459,6 +459,10 @@ static struct wlr_output *wlr_output_layout_output_in_direction(
|
||||
|
||||
struct wlr_box ref_box;
|
||||
wlr_output_layout_get_box(layout, reference, &ref_box);
|
||||
if (wlr_box_empty(&ref_box)) {
|
||||
// The output doesn't belong to the layout
|
||||
return NULL;
|
||||
}
|
||||
|
||||
double min_distance = (distance_method == NEAREST) ? DBL_MAX : DBL_MIN;
|
||||
struct wlr_output *closest_output = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user