From 66336521ed7520edbf60297509ed000bdcbcb21c Mon Sep 17 00:00:00 2001 From: Seungheon Oh Date: Tue, 14 Jan 2020 15:16:06 -0600 Subject: [PATCH 1/2] Fix: Shift mask now being recognized --- sowm.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sowm.c b/sowm.c index 48222c6..6b9f794 100644 --- a/sowm.c +++ b/sowm.c @@ -49,7 +49,7 @@ static void ws_go(const Arg arg); static int xerror() { return 0;} static client *list = {0}, *ws_list[10] = {0}, *cur; -static int ws = 1, sw, sh, wx, wy, numlock; +static int ws = 1, sw, sh, wx, wy; static unsigned int ww, wh; static Display *d; @@ -71,7 +71,6 @@ static void (*events[LASTEvent])(XEvent *e) = { #define win (client *t=0, *c=list; c && t!=list->prev; t=c, c=c->next) #define ws_save(W) ws_list[W] = list #define ws_sel(W) list = ws_list[ws = W] -#define mask(M) (M & ~(numlock | LockMask)) #define win_size(W, gx, gy, gw, gh) \ XGetGeometry(d, W, &(Window){0}, gx, gy, gw, gh, \ @@ -112,13 +111,10 @@ void notify_motion(XEvent *e) { 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) { - numlock = ((e->xkey.state & keys[i].mod) == keys[i].mod); - - if (mask(keys[i].mod) == mask(e->xkey.state) && + for (unsigned int i=0; i < sizeof(keys)/sizeof(*keys); ++i) + if (keys[i].mod == e->xkey.state && keys[i].keysym == keysym) keys[i].function(keys[i].arg); - } } void button_press(XEvent *e) { From 1cce61e1866eb9b8027009e9ea64132af1825f3e Mon Sep 17 00:00:00 2001 From: Seungheon Oh Date: Tue, 14 Jan 2020 15:28:19 -0600 Subject: [PATCH 2/2] Fix: disabled 'missing-prototypes' warning --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c216b04..50ed1cb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CFLAGS+= -std=c99 -Wall -Wextra -Wmissing-prototypes -pedantic +CFLAGS+= -std=c99 -Wall -Wextra -pedantic LDADD+= -lX11 LDFLAGS= PREFIX?= /usr