mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05: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
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue