mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-20 06:59:50 -05:00
opt: optimize viewcrossmon
This commit is contained in:
parent
eedff5b085
commit
633a11b225
1 changed files with 2 additions and 5 deletions
|
|
@ -186,7 +186,7 @@ int focusmon(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!m || !m->wlr_output->enabled)
|
||||
if (!m || !m->wlr_output->enabled || m == selmon)
|
||||
return 0;
|
||||
|
||||
old_selmon_sel = selmon->sel;
|
||||
|
|
@ -1426,10 +1426,7 @@ int viewtoright_have_client(const Arg *arg) {
|
|||
}
|
||||
|
||||
int viewcrossmon(const Arg *arg) {
|
||||
// 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});
|
||||
focusmon(&(Arg){.v = arg->v, .i = UNDIR});
|
||||
view_in_mon(arg, true, selmon, true);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue