summaryrefslogtreecommitdiff
path: root/dwm/patch/combo.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm/patch/combo.c')
-rwxr-xr-xdwm/patch/combo.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/dwm/patch/combo.c b/dwm/patch/combo.c
new file mode 100755
index 0000000..0b0bc5a
--- /dev/null
+++ b/dwm/patch/combo.c
@@ -0,0 +1,39 @@
+static int combo = 0;
+
+#if !BAR_HOLDBAR_PATCH
+void
+keyrelease(XEvent *e)
+{
+ combo = 0;
+}
+#endif // !BAR_HOLDBAR_PATCH
+
+void
+combotag(const Arg *arg)
+{
+ if (selmon->sel && arg->ui & TAGMASK) {
+ #if SWITCHTAG_PATCH
+ if (selmon->sel->switchtag)
+ selmon->sel->switchtag = 0;
+ #endif // SWITCHTAG_PATCH
+ if (combo) {
+ selmon->sel->tags |= arg->ui & TAGMASK;
+ } else {
+ combo = 1;
+ selmon->sel->tags = arg->ui & TAGMASK;
+ }
+ arrange(selmon);
+ focus(NULL);
+ }
+}
+
+void
+comboview(const Arg *arg)
+{
+ if (combo) {
+ view(&((Arg) { .ui = selmon->tagset[selmon->seltags] | (arg->ui & TAGMASK) }));
+ } else {
+ combo = 1;
+ view(arg);
+ }
+}