summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Rumbaugh <doug@douglasrumbaugh.com>2022-01-12 14:56:48 -0500
committerDouglas Rumbaugh <doug@douglasrumbaugh.com>2022-01-12 14:56:48 -0500
commitaff663b62e7d603c0796485fcd42002a37c64c82 (patch)
treedddddac61e6deb5b62035b06df1278bba7f9041c
parent60da42738a44896956b4cb31a00e686e40e11fc3 (diff)
downloaddwm-aff663b62e7d603c0796485fcd42002a37c64c82.tar.gz
Enabled switching to tags by clicking
This is a little fragile, but it seems like it works at least for my configuration. If you do a SUPER+SHIFT+CLICK1 on a window, it will activate all the tags associated with that window. The main idea here is to allow going to the tags of a window from view all tags with a mouse click.
-rw-r--r--config.def.h1
-rw-r--r--dwm.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/config.def.h b/config.def.h
index b82f181..4063264 100644
--- a/config.def.h
+++ b/config.def.h
@@ -306,6 +306,7 @@ static Button buttons[] = {
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
+ { ClkClientWin, MODKEY|ShiftMask, Button1, view, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
diff --git a/dwm.c b/dwm.c
index e592be9..080e24d 100644
--- a/dwm.c
+++ b/dwm.c
@@ -575,6 +575,7 @@ buttonpress(XEvent *e)
} else
click = ClkWinTitle;
} else if ((c = wintoclient(ev->window))) {
+ arg.ui = c->tags;
focus(c);
restack(selmon);
XAllowEvents(dpy, ReplayPointer, CurrentTime);
@@ -583,7 +584,7 @@ buttonpress(XEvent *e)
for (i = 0; i < LENGTH(buttons); i++)
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
&& CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
- buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
+ buttons[i].func((click == ClkTagBar || click == ClkClientWin) && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
}
void