From a10bee93be3f2ad370a6dfc360e1b05cb84e7f5c Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 18 Oct 2016 17:03:30 +0000 Subject: Refactor callbacks to take a void * so as to not try and generalize into client_ctx in keypress and buttonpress event handlers; pass appropriate *ctx's based on context. While here, limit some globals, replace defines with appropriate variables and fix some naming. --- group.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'group.c') diff --git a/group.c b/group.c index abf3b7b..7f2363f 100644 --- a/group.c +++ b/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.123 2016/10/04 15:18:20 okan Exp $ + * $OpenBSD: group.c,v 1.124 2016/10/18 17:03:30 okan Exp $ */ #include @@ -265,7 +265,7 @@ group_cycle(struct screen_ctx *sc, int flags) newgc = oldgc; for (;;) { - newgc = (flags & CWM_CLIENT_RCYCLE) ? group_prev(newgc) : + newgc = (flags & CWM_CYCLE_REVERSE) ? group_prev(newgc) : group_next(newgc); if (newgc == oldgc) @@ -304,8 +304,8 @@ group_prev(struct group_ctx *gc) struct screen_ctx *sc = gc->sc; struct group_ctx *newgc; - return(((newgc = TAILQ_PREV(gc, group_ctx_q, entry)) != NULL) ? - newgc : TAILQ_LAST(&sc->groupq, group_ctx_q)); + return(((newgc = TAILQ_PREV(gc, group_q, entry)) != NULL) ? + newgc : TAILQ_LAST(&sc->groupq, group_q)); } void @@ -351,21 +351,21 @@ int group_autogroup(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - struct autogroupwin *aw; + struct autogroup *ag; struct group_ctx *gc; int num = -1, both_match = 0; if (cc->ch.res_class == NULL || cc->ch.res_name == NULL) return(0); - TAILQ_FOREACH(aw, &Conf.autogroupq, entry) { - if (strcmp(aw->class, cc->ch.res_class) == 0) { - if ((aw->name != NULL) && - (strcmp(aw->name, cc->ch.res_name) == 0)) { - num = aw->num; + TAILQ_FOREACH(ag, &Conf.autogroupq, entry) { + if (strcmp(ag->class, cc->ch.res_class) == 0) { + if ((ag->name != NULL) && + (strcmp(ag->name, cc->ch.res_name) == 0)) { + num = ag->num; both_match = 1; - } else if (aw->name == NULL && !both_match) - num = aw->num; + } else if (ag->name == NULL && !both_match) + num = ag->num; } } -- cgit v1.2.3-2-gb3c3