From de3d8ce7bfb2da535b0c1e3d94a8f1cee9f2410c 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 88a16ff..3826a45 100644 --- a/dwl.c +++ b/dwl.c @@ -1841,8 +1841,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