From bca077b9279f28c12cced63f0a556c0556f7169c Mon Sep 17 00:00:00 2001
From: A Frederick Christensen <dwl@ivories.org>
Date: Sun, 2 Jun 2024 14:19:24 -0500
Subject: Allow negative coordinates in MonitorRules

Monitor/output position (-1, -1) remains as a single indicator value for autoconfigure layout.
Additionally, one minor comment typo is corrected.
---
 dwl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'dwl.c')

diff --git a/dwl.c b/dwl.c
index 52bfbc8..1ea7f2a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -927,14 +927,14 @@ createmon(struct wl_listener *listener, void *data)
 	m->fullscreen_bg = wlr_scene_rect_create(layers[LyrFS], 0, 0, fullscreen_bg);
 	wlr_scene_node_set_enabled(&m->fullscreen_bg->node, 0);
 
-	/* Adds this to the output layout in the order it was configured in.
+	/* Adds this to the output layout in the order it was configured.
 	 *
 	 * The output layout utility automatically adds a wl_output global to the
 	 * display, which Wayland clients can see to find out information about the
 	 * output (such as DPI, scale factor, manufacturer, etc).
 	 */
 	m->scene_output = wlr_scene_output_create(scene, wlr_output);
-	if (m->m.x < 0 || m->m.y < 0)
+	if (m->m.x == -1 && m->m.y == -1)
 		wlr_output_layout_add_auto(output_layout, wlr_output);
 	else
 		wlr_output_layout_add(output_layout, wlr_output, m->m.x, m->m.y);
-- 
cgit v1.2.3