From a7aa847332ee80b281feeab6ce0544e48563d714 Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 21 May 2015 00:37:04 +0000 Subject: merge kbd and mouse grouptoggle --- calmwm.h | 4 +--- conf.c | 6 +++--- kbfunc.c | 10 ++++++---- mousefunc.c | 8 +------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/calmwm.h b/calmwm.h index 7818f0b..9681411 100644 --- a/calmwm.h +++ b/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.288 2015/05/20 23:54:39 okan Exp $ + * $OpenBSD: calmwm.h,v 1.289 2015/05/21 00:37:04 okan Exp $ */ #ifndef _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 996811c..2241a29 100644 --- a/conf.c +++ b/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.186 2015/05/17 04:34:01 kspillner Exp $ + * $OpenBSD: conf.c,v 1.187 2015/05/21 00:37:04 okan Exp $ */ #include @@ -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 e6798f9..1615788 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: kbfunc.c,v 1.105 2015/01/19 14:54:16 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.106 2015/05/21 00:37:04 okan Exp $ */ #include @@ -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 443b888..2fe6908 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: mousefunc.c,v 1.86 2015/01/19 14:54:16 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.87 2015/05/21 00:37:04 okan Exp $ */ #include @@ -172,12 +172,6 @@ mousefunc_client_move(struct client_ctx *cc, union arg *arg) /* NOTREACHED */ } -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) { -- cgit v1.2.3-2-gb3c3