mfwm

A tiling fork of dylanaraps sowm.
git clone git://depsterr.com/git/mfwm
Log | Files | Refs | README | LICENSE

commit 2292f86d7fb861a22aa5f076a82453ab6927e54b
parent e4965417f760f1331cbabcf350a875246e160e69
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Sun, 24 Nov 2019 14:24:13 +0000

sowm: potential fix for key bug

Diffstat:
Msowm.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sowm.c b/sowm.c @@ -71,6 +71,9 @@ static void (*events[LASTEvent])(XEvent *e) = { #define ws_save(W) ws_list[W] = list #define ws_sel(W) list = ws_list[ws = W] +#define mask(m) (m & ~(LockMask) & \ + (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) + #define win_size(W, gx, gy, gw, gh) \ XGetGeometry(d, W, &(Window){0}, gx, gy, gw, gh, \ &(unsigned int){0}, &(unsigned int){0}) @@ -111,7 +114,8 @@ void key_press(XEvent *e) { KeySym keysym = XkbKeycodeToKeysym(d, e->xkey.keycode, 0, 0); for (unsigned int i=0; i < sizeof(keys)/sizeof(*keys); ++i) - if (keys[i].mod == e->xkey.state && keys[i].keysym == keysym) + if (keys[i].keysym == keysym && + mask(keys[i].mod) == mask(e->xkey.state)) keys[i].function(keys[i].arg); }