summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2015-05-21 00:37:04 +0000
committerokan <okan>2015-05-21 00:37:04 +0000
commitb1c2046efd856c4d32ba1a50a83e8b651f1769bd (patch)
tree09f45b33171170c428c6a6ebf3775e553cd0748a
parent31d4fe9f33d5bb80c3e490c5dbbbd774b0a124a4 (diff)
downloadcwm-b1c2046efd856c4d32ba1a50a83e8b651f1769bd.tar.gz
cwm-b1c2046efd856c4d32ba1a50a83e8b651f1769bd.tar.xz
cwm-b1c2046efd856c4d32ba1a50a83e8b651f1769bd.zip
merge kbd and mouse grouptoggle
-rw-r--r--calmwm.h2
-rw-r--r--conf.c4
-rw-r--r--kbfunc.c8
-rw-r--r--mousefunc.c6
4 files changed, 7 insertions, 13 deletions
diff --git a/calmwm.h b/calmwm.h
index ddc60f2..3b297b0 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -495,8 +495,6 @@ void			 kbfunc_ssh(struct client_ctx *, union arg *);
 void			 kbfunc_term(struct client_ctx *, union arg *);
 void 			 kbfunc_tile(struct client_ctx *, union arg *);
 
-void			 mousefunc_client_grouptoggle(struct client_ctx *,
-			    union arg *);
 void			 mousefunc_client_move(struct client_ctx *,
     			    union arg *);
 void			 mousefunc_client_resize(struct client_ctx *,
diff --git a/conf.c b/conf.c
index 42a1c08..a202e73 100644
--- a/conf.c
+++ b/conf.c
@@ -391,7 +391,7 @@ static const struct {
 	    {.i = CWM_CYCLE|CWM_INGROUP} },
 	{ "rcycleingroup", kbfunc_client_cycle, CWM_WIN,
 	    {.i = CWM_RCYCLE|CWM_INGROUP} },
-	{ "grouptoggle", kbfunc_client_grouptoggle, CWM_WIN, {0}},
+	{ "grouptoggle", kbfunc_client_grouptoggle, CWM_WIN, {.i = 0}},
 	{ "sticky", kbfunc_client_toggle_sticky, CWM_WIN, {0} },
 	{ "fullscreen", kbfunc_client_toggle_fullscreen, CWM_WIN, {0} },
 	{ "maximize", kbfunc_client_toggle_maximize, CWM_WIN, {0} },
@@ -460,7 +460,7 @@ static const struct {
 	{ "window_hide", kbfunc_client_hide, CWM_WIN, {0} },
 	{ "window_move", mousefunc_client_move, CWM_WIN, {0} },
 	{ "window_resize", mousefunc_client_resize, CWM_WIN, {0} },
-	{ "window_grouptoggle", mousefunc_client_grouptoggle, CWM_WIN, {0} },
+	{ "window_grouptoggle", kbfunc_client_grouptoggle, CWM_WIN, {.i = 1} },
 	{ "menu_group", mousefunc_menu_group, 0, {0} },
 	{ "menu_unhide", mousefunc_menu_unhide, 0, {0} },
 	{ "menu_cmd", mousefunc_menu_cmd, 0, {0} },
diff --git a/kbfunc.c b/kbfunc.c
index 388ead7..ba1f96a 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -435,9 +435,11 @@ kbfunc_client_nogroup(struct client_ctx *cc, union arg *arg)
 void
 kbfunc_client_grouptoggle(struct client_ctx *cc, union arg *arg)
 {
-	/* XXX for stupid X apps like xpdf and gvim */
-	XGrabKeyboard(X_Dpy, cc->win, True,
-	    GrabModeAsync, GrabModeAsync, CurrentTime);
+	if (arg->i == 0) {
+		/* XXX for stupid X apps like xpdf and gvim */
+		XGrabKeyboard(X_Dpy, cc->win, True,
+		    GrabModeAsync, GrabModeAsync, CurrentTime);
+	}
 
 	group_toggle_membership_enter(cc);
 }
diff --git a/mousefunc.c b/mousefunc.c
index 14138a6..271e732 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -173,12 +173,6 @@ mousefunc_client_move(struct client_ctx *cc, union arg *arg)
 }
 
 void
-mousefunc_client_grouptoggle(struct client_ctx *cc, union arg *arg)
-{
-	group_toggle_membership_enter(cc);
-}
-
-void
 mousefunc_menu_group(struct client_ctx *cc, union arg *arg)
 {
 	struct screen_ctx	*sc = cc->sc;