summaryrefslogtreecommitdiffstats
path: root/dwl.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 2ed00f4..44796b9 100644
--- a/dwl.c
+++ b/dwl.c
@@ -386,6 +386,7 @@ static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void togglegaps(const Arg *arg);
static void togglepointerconstraints(const Arg *arg);
+static void togglepassthrough(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -704,6 +705,11 @@ buttonpress(struct wl_listener *listener, void *data)
for (b = buttons; b < END(buttons); b++) {
if (CLEANMASK(mods) == CLEANMASK(b->mod) &&
event->button == b->button && b->func) {
+ if (passthrough) {
+ if (b->func != togglepassthrough) continue;
+ b->func(&b->arg);
+ break;
+ }
b->func(&b->arg);
return;
}
@@ -1961,6 +1967,8 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
for (k = keys; k < END(keys); k++) {
if (CLEANMASK(mods) == CLEANMASK(k->mod)
&& sym == k->keysym && k->func) {
+ if (passthrough && k->func != togglepassthrough)
+ continue;
k->func(&k->arg);
return 1;
}
@@ -3191,6 +3199,12 @@ togglepointerconstraints(const Arg *arg)
}
void
+togglepassthrough(const Arg *arg)
+{
+ passthrough = !passthrough;
+}
+
+void
toggletag(const Arg *arg)
{
uint32_t newtags;