Prevent cursor warp if monitor is already selected

This commit is contained in:
reDpz 2025-10-29 14:41:48 +00:00
parent 718ed47dfc
commit 5d1c970b80

View file

@ -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;
}