opt: optimize viewcrossmon
This commit is contained in:
@@ -185,7 +185,7 @@ int focusmon(const Arg *arg) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m || !m->wlr_output->enabled)
|
if (!m || !m->wlr_output->enabled || m == selmon)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
old_selmon_sel = selmon->sel;
|
old_selmon_sel = selmon->sel;
|
||||||
@@ -1423,10 +1423,7 @@ int viewtoright_have_client(const Arg *arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int viewcrossmon(const Arg *arg) {
|
int viewcrossmon(const Arg *arg) {
|
||||||
// Don't switch monitors if monitor is already focused
|
focusmon(&(Arg){.v = arg->v, .i = UNDIR});
|
||||||
// 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);
|
view_in_mon(arg, true, selmon, true);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user