From 09e40c15476fed118fa0506eea71270dfbee6141 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Fri, 10 May 2024 15:46:42 +0200 Subject: [PATCH] Apply accessnthmon-movecursor patch --- dwl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dwl.c b/dwl.c index 4c75d90..8887d39 100644 --- a/dwl.c +++ b/dwl.c @@ -1828,8 +1828,17 @@ void focusnthmon(const Arg *arg) { Monitor *m = numtomon(arg->i); - if (m == selmon || m == NULL) + + if (!m) + return; + + if (m == selmon) { + double target_x = m->m.x + m->m.width / 2; + double target_y = m->m.y + m->m.height / 2; + wlr_cursor_move(cursor, NULL, target_x - cursor->x, target_y - cursor->y); return; + } + selmon = m; focusclient(focustop(selmon), 1); } -- 2.48.1