From aff663b62e7d603c0796485fcd42002a37c64c82 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 12 Jan 2022 14:56:48 -0500 Subject: 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. --- config.def.h | 1 + dwm.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3