From cfa2f9e3fff4a5b0c220b53b9452c6639debad63 Mon Sep 17 00:00:00 2001 From: Okan Demirmen Date: Mon, 8 Sep 2014 13:51:30 +0000 Subject: Now that a group knows its screen, only pass down the group_ctx. --- app/cwm/calmwm.h | 6 +++--- app/cwm/group.c | 34 +++++++++++++++++----------------- app/cwm/mousefunc.c | 4 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'app') diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 7ae23f501..cd16f372d 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/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.271 2014/09/07 20:57:26 okan Exp $ + * $OpenBSD: calmwm.h,v 1.272 2014/09/08 13:51:29 okan Exp $ */ #ifndef _CALMWM_H_ @@ -408,12 +408,12 @@ void group_alltoggle(struct screen_ctx *); void group_autogroup(struct client_ctx *); void group_cycle(struct screen_ctx *, int); int group_hidden_state(struct group_ctx *); -void group_hide(struct screen_ctx *, struct group_ctx *); +void group_hide(struct group_ctx *); void group_hidetoggle(struct screen_ctx *, int); void group_init(struct screen_ctx *); void group_movetogroup(struct client_ctx *, int); void group_only(struct screen_ctx *, int); -void group_show(struct screen_ctx *, struct group_ctx *); +void group_show(struct group_ctx *); void group_sticky(struct client_ctx *); void group_sticky_toggle_enter(struct client_ctx *); void group_sticky_toggle_exit(struct client_ctx *); diff --git a/app/cwm/group.c b/app/cwm/group.c index 95126abf9..c887e10b1 100644 --- a/app/cwm/group.c +++ b/app/cwm/group.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: group.c,v 1.100 2014/09/07 20:57:26 okan Exp $ + * $OpenBSD: group.c,v 1.101 2014/09/08 13:51:29 okan Exp $ */ #include @@ -33,7 +33,7 @@ #include "calmwm.h" static void group_assign(struct group_ctx *, struct client_ctx *); -static void group_restack(struct screen_ctx *, struct group_ctx *); +static void group_restack(struct group_ctx *); static void group_setactive(struct screen_ctx *, long); const char *num_to_name[] = { @@ -56,30 +56,30 @@ group_assign(struct group_ctx *gc, struct client_ctx *cc) } void -group_hide(struct screen_ctx *sc, struct group_ctx *gc) +group_hide(struct group_ctx *gc) { struct client_ctx *cc; - screen_updatestackingorder(sc); + screen_updatestackingorder(gc->sc); TAILQ_FOREACH(cc, &gc->clients, group_entry) client_hide(cc); } void -group_show(struct screen_ctx *sc, struct group_ctx *gc) +group_show(struct group_ctx *gc) { struct client_ctx *cc; TAILQ_FOREACH(cc, &gc->clients, group_entry) client_unhide(cc); - group_restack(sc, gc); - group_setactive(sc, gc->num); + group_restack(gc); + group_setactive(gc->sc, gc->num); } static void -group_restack(struct screen_ctx *sc, struct group_ctx *gc) +group_restack(struct group_ctx *gc) { struct client_ctx *cc; Window *winlist; @@ -238,9 +238,9 @@ group_hidetoggle(struct screen_ctx *sc, int idx) } if (group_hidden_state(gc)) - group_show(sc, gc); + group_show(gc); else { - group_hide(sc, gc); + group_hide(gc); /* make clients stick to empty group */ if (TAILQ_EMPTY(&gc->clients)) group_setactive(sc, idx); @@ -257,9 +257,9 @@ group_only(struct screen_ctx *sc, int idx) TAILQ_FOREACH(gc, &sc->groupq, entry) { if (gc->num == idx) - group_show(sc, gc); + group_show(gc); else - group_hide(sc, gc); + group_hide(gc); } } @@ -286,16 +286,16 @@ group_cycle(struct screen_ctx *sc, int flags) if (!TAILQ_EMPTY(&gc->clients) && showgroup == NULL) showgroup = gc; else if (!group_hidden_state(gc)) - group_hide(sc, gc); + group_hide(gc); } if (showgroup == NULL) return; - group_hide(sc, sc->group_active); + group_hide(sc->group_active); if (group_hidden_state(showgroup)) - group_show(sc, showgroup); + group_show(showgroup); else group_setactive(sc, showgroup->num); } @@ -307,9 +307,9 @@ group_alltoggle(struct screen_ctx *sc) TAILQ_FOREACH(gc, &sc->groupq, entry) { if (sc->group_hideall) - group_show(sc, gc); + group_show(gc); else - group_hide(sc, gc); + group_hide(gc); } sc->group_hideall = !sc->group_hideall; } diff --git a/app/cwm/mousefunc.c b/app/cwm/mousefunc.c index 8e27461e6..613f21df9 100644 --- a/app/cwm/mousefunc.c +++ b/app/cwm/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.77 2014/09/06 16:08:58 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.78 2014/09/08 13:51:29 okan Exp $ */ #include @@ -201,7 +201,7 @@ mousefunc_menu_group(struct client_ctx *cc, union arg *arg) NULL, NULL)) != NULL) { gc = (struct group_ctx *)mi->ctx; (group_hidden_state(gc)) ? - group_show(sc, gc) : group_hide(sc, gc); + group_show(gc) : group_hide(gc); } menuq_clear(&menuq); -- cgit v1.2.3