From 5d1c970b8078be4b111a0ef621dabeaed2f86b37 Mon Sep 17 00:00:00 2001 From: reDpz Date: Wed, 29 Oct 2025 14:41:48 +0000 Subject: [PATCH] Prevent cursor warp if monitor is already selected --- src/dispatch/bind_define.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 383fd9af..ea7ca646 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -1423,7 +1423,10 @@ int viewtoright_have_client(const Arg *arg) { } int viewcrossmon(const Arg *arg) { - focusmon(&(Arg){.v = arg->v, .i = UNDIR}); + // Don't switch monitors if monitor is already focused + // This also prevents cursorwarp + if (!regex_match(arg->v, selmon->wlr_output->name)) + focusmon(&(Arg){.v = arg->v, .i = UNDIR}); view_in_mon(arg, true, selmon, true); return 0; }