aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorStivvo <stivvo01@gmail.com>2020-10-30 23:49:01 +0100
committerStivvo <stivvo01@gmail.com>2020-10-30 23:49:01 +0100
commit62fb4c086ea5080977edc4ec017390aa924607ed (patch)
tree44f19dba1a27ffcbf6714dd77b9d61aa6b225674 /dwl.c
parent388ab9df2f655e7bd228b98ccf48ab612c0ffe4e (diff)
Block access to disabled monitor
Before this, pressing mod+comma or mod+period (focusmon function) moved the focus to disabed monitors. Now, all disabled monitors are skipped
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/dwl.c b/dwl.c
index 0432b42..6bbf8b9 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1087,10 +1087,12 @@ focusclient(Client *old, Client *c, int lift)
void
focusmon(const Arg *arg)
{
- Client *sel = selclient();
-
- selmon = dirtomon(arg->i);
- focusclient(sel, focustop(selmon), 1);
+ Client *sel;
+ do {
+ sel = selclient();
+ selmon = dirtomon(arg->i);
+ focusclient(sel, focustop(selmon), 1);
+ } while (!selmon->wlr_output->enabled);
}
void