Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,16 @@ static Button buttons[] = {
{ ClkClientWin, MODKEY|Mod1Mask, Button3, forceresizemouse, {0} },
{ ClkClientWin, MODKEY|ShiftMask, Button3, resizeaspectmouse, {0} },
{ ClkTagBar, 0, Button1, dragtag, {0} },
{ ClkTagBar, ControlMask, Button1, dragtag, {0} },
{ ClkTagBar, ShiftMask, Button1, dragtag, {0} },
{ ClkTagBar, ShiftMask|ControlMask, Button1, dragtag, {0} },
{ ClkTagBar, Mod1Mask, Button1, dragtag, {0} },
{ ClkTagBar, 0, Button5, viewtoright, {0} },
{ ClkTagBar, MODKEY, Button4, shiftview, {.i = -1 } },
{ ClkTagBar, MODKEY, Button5, shiftview, {.i = +1 } },
{ ClkTagBar, 0, Button4, viewtoleft, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, Mod1Mask, Button1, followtag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
{ ClkShutDown, 0, Button1, spawn, {.v = instantshutdowncmd } },
{ ClkShutDown, 0, Button3, spawn, {.v = slockcmd } },
Expand Down
26 changes: 24 additions & 2 deletions instantwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3352,7 +3352,20 @@ dragtag(const Arg *arg)
if (!tagwidth)
tagwidth = gettagwidth();
if ((arg->ui & TAGMASK) != selmon->tagset[selmon->seltags]) {
view(arg);
unsigned int state;
int x;
Window dummy;
XQueryPointer(dpy, root, &dummy, &dummy, &x, &x, &x, &x, &state);
if ((state & ShiftMask) && (state & ControlMask))
toggletag(arg);
else if (state & ShiftMask)
tag(arg);
else if (state & ControlMask)
toggleview(arg);
else if (state & Mod1Mask)
followtag(arg);
else
view(arg);
return;
}

Expand Down Expand Up @@ -3396,10 +3409,19 @@ dragtag(const Arg *arg)

if (!leftbar) {
if (ev.xmotion.x_root < selmon->mx + tagwidth) {
if (ev.xmotion.state & ShiftMask) {
if ((ev.xmotion.state & ShiftMask) && (ev.xmotion.state & ControlMask)) {
if (tagprefix) {
tagall(&((Arg) { .ui = 1 << getxtag(ev.xmotion.x_root) }));
tagprefix = 1;
} else
tagall(&((Arg) { .ui = 1 << getxtag(ev.xmotion.x_root) }));
view(&((Arg) { .ui = 1 << getxtag(ev.xmotion.x_root) }));
} else if (ev.xmotion.state & ShiftMask) {
followtag(&((Arg) { .ui = 1 << getxtag(ev.xmotion.x_root) }));
} else if (ev.xmotion.state & ControlMask) {
tagall(&((Arg) { .ui = 1 << getxtag(ev.xmotion.x_root) }));
} else if (ev.xmotion.state & Mod1Mask) {
swaptags(&((Arg) { .ui = 1 << getxtag(ev.xmotion.x_root) }));
} else {
tag(&((Arg) { .ui = 1 << getxtag(ev.xmotion.x_root) }));
}
Expand Down