~ruther/dwl

f8dd1e5c3cb263ec546720a881f0f5116f8926db — Rutherther 11 months ago 09eeede patch/accessnthmonitor-movemouse
feat: move mouse to center of monitor if focused again
1 files changed, 9 insertions(+), 1 deletions(-)

M dwl.c
M dwl.c => dwl.c +9 -1
@@ 1347,8 1347,16 @@ void
focusnthmon(const Arg *arg)
{
	Monitor *m = numtomon(arg->i);
	if (m == selmon || m == NULL)
	if (m == NULL) {
		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);
}

Do not follow this link