diff --git a/src/client.c b/src/client.c index 5ec51d9..ca9c439 100644 --- a/src/client.c +++ b/src/client.c @@ -14,8 +14,6 @@ #include "screen.h" #include "mouse.h" -#define CLIENT_MOUSE_MOD Mod1Mask - #define CLIENT_RESIZE_DIR(D) \ void uicb_client_resize_##D(Uicb cmd) \ { \ @@ -322,13 +320,13 @@ client_grabbuttons(struct client *c, bool focused) while(i++ != Button5) { - XGrabButton(W->dpy, i, CLIENT_MOUSE_MOD, c->win, False, + XGrabButton(W->dpy, i, W->client_mod, c->win, False, ButtonMask, GrabModeAsync, GrabModeSync, None, None); - XGrabButton(W->dpy, i, CLIENT_MOUSE_MOD | LockMask, c->win, False, + XGrabButton(W->dpy, i, W->client_mod | LockMask, c->win, False, ButtonMask, GrabModeAsync, GrabModeSync, None, None); - XGrabButton(W->dpy, i, CLIENT_MOUSE_MOD | W->numlockmask, c->win, False, + XGrabButton(W->dpy, i, W->client_mod | W->numlockmask, c->win, False, ButtonMask, GrabModeAsync, GrabModeSync, None, None); - XGrabButton(W->dpy, i, CLIENT_MOUSE_MOD | LockMask | W->numlockmask, c->win, False, + XGrabButton(W->dpy, i, W->client_mod | LockMask | W->numlockmask, c->win, False, ButtonMask, GrabModeAsync, GrabModeSync, None, None); } @@ -735,6 +733,7 @@ static void client_frame_new(struct client *c) { struct barwin *frameb; + struct barwin *clientb; XSetWindowAttributes at = { .background_pixel = c->ncol.bg, @@ -745,6 +744,7 @@ client_frame_new(struct client *c) /* Use a fake barwin only to store mousebinds of frame win */ frameb = barwin_new(W->root, 0, 0, 1, 1, 0, 0, false); + clientb = barwin_new(W->root, 0, 0, 1, 1, 0, 0, false); frameb->win = c->frame = XCreateWindow(W->dpy, W->root, @@ -755,8 +755,10 @@ client_frame_new(struct client *c) CopyFromParent, (CWOverrideRedirect | CWBackPixmap | CWBackPixel | CWEventMask), &at); + clientb->win = c->win; frameb->mousebinds = W->tmp_head.client; + clientb->mousebinds = W->tmp_head.client; if(c->tbarw > c->border) { diff --git a/src/config.c b/src/config.c index 5b6381c..fe62888 100644 --- a/src/config.c +++ b/src/config.c @@ -83,7 +83,6 @@ config_theme(void) t->tags_border_col = color_atoh(fetch_opt_first(ks[i], "#888888", "tags_border_color").str); t->tags_border_width = fetch_opt_first(ks[i], "0", "tags_border_width").num; - /* status line */ t->tags_n_sl = status_new_ctx(NULL, t); t->tags_s_sl = status_new_ctx(NULL, t); @@ -207,6 +206,8 @@ config_client(void) /* [client] */ sec = fetch_section_first(NULL, "client"); + W->client_mod = modkey_keysym(fetch_opt_first(sec, "Super", "key_modifier").str); + /* [mouse] */ /* for client frame AND titlebar */ if((mb = fetch_section(sec, "mouse"))) diff --git a/src/wmfs.h b/src/wmfs.h index a8ffd3a..2ac62ef 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -305,6 +305,7 @@ struct wmfs int xscreen, xdepth; int xmaxw, xmaxh; int nscreen; + unsigned int client_mod; Flags numlockmask; #define WMFS_SCAN 0x01 #define WMFS_RUNNING 0x02 diff --git a/wmfsrc b/wmfsrc index d60f42f..01adc26 100644 --- a/wmfsrc +++ b/wmfsrc @@ -112,6 +112,8 @@ [client] + key_modifier = "Super" + [mouse] button = "1" func = "client_focus_click" [/mouse] [mouse] button = "1" func = "mouse_swap" [/mouse] [mouse] button = "2" func = "mouse_tab" [/mouse]