summaryrefslogtreecommitdiffstats
path: root/dwl.c
diff options
context:
space:
mode:
authorchoc <notchoc@proton.me>2023-01-02 13:00:29 +0800
committerSquibid <me@zacharyscheiman.com>2025-02-12 00:23:37 -0600
commitce17d0f303a11a8eaaf1a78202002b111bec9008 (patch)
tree71ea03a8d2ac556de2f944534214db31087d4c2d /dwl.c
parentfd74d172c2a69cd1583e180c8fb111171e35118b (diff)
downloaddwl-ce17d0f303a11a8eaaf1a78202002b111bec9008.tar.gz
dwl-ce17d0f303a11a8eaaf1a78202002b111bec9008.tar.bz2
dwl-ce17d0f303a11a8eaaf1a78202002b111bec9008.zip
passthrough: allow pausing keybind handling
also allows for bitcarrying-esque control of nested instances
Diffstat (limited to 'dwl.c')
-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;