aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/wlr_output_layout.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types/wlr_output_layout.c b/types/wlr_output_layout.c
index 275f87d7..37c57fc6 100644
--- a/types/wlr_output_layout.c
+++ b/types/wlr_output_layout.c
@@ -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;