diff options
author | choc <notchoc@proton.me> | 2023-01-02 13:00:29 +0800 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2025-02-12 00:23:37 -0600 |
commit | ce17d0f303a11a8eaaf1a78202002b111bec9008 (patch) | |
tree | 71ea03a8d2ac556de2f944534214db31087d4c2d /dwl.c | |
parent | fd74d172c2a69cd1583e180c8fb111171e35118b (diff) | |
download | dwl-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.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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; |