cvsimport

This commit is contained in:
okan
2013-01-06 01:01:26 +00:00
10 changed files with 140 additions and 202 deletions

16
group.c
View File

@@ -132,7 +132,7 @@ group_show(struct screen_ctx *sc, struct group_ctx *gc)
free(winlist);
gc->hidden = 0;
group_setactive(sc, gc->shortcut - 1);
group_setactive(sc, gc->shortcut);
}
void
@@ -151,7 +151,7 @@ group_init(struct screen_ctx *sc)
for (i = 0; i < CALMWM_NGROUPS; i++) {
TAILQ_INIT(&sc->groups[i].clients);
sc->groups[i].hidden = 0;
sc->groups[i].shortcut = i + 1;
sc->groups[i].shortcut = i;
TAILQ_INSERT_TAIL(&sc->groupq, &sc->groups[i], entry);
}
@@ -269,12 +269,8 @@ group_hidetoggle(struct screen_ctx *sc, int idx)
if (gc->hidden)
group_show(sc, gc);
else {
else
group_hide(sc, gc);
/* XXX wtf? */
if (TAILQ_EMPTY(&gc->clients))
group_setactive(sc, idx);
}
}
void
@@ -327,7 +323,7 @@ group_cycle(struct screen_ctx *sc, int flags)
if (showgroup->hidden)
group_show(sc, showgroup);
else
group_setactive(sc, showgroup->shortcut - 1);
group_setactive(sc, showgroup->shortcut);
}
/* called when a client is deleted */
@@ -420,7 +416,7 @@ group_autogroup(struct client_ctx *cc)
else if (*grpno > CALMWM_NGROUPS || *grpno < 0)
no = CALMWM_NGROUPS - 1;
else
no = *grpno + 1;
no = *grpno;
XFree(grpno);
} else {
TAILQ_FOREACH(aw, &Conf.autogroupq, entry) {
@@ -480,7 +476,7 @@ group_update_names(struct screen_ctx *sc)
*/
if (n < CALMWM_NGROUPS) {
setnames = 1;
i = 1;
i = 0;
while (n < CALMWM_NGROUPS)
strings[n++] = xstrdup(shortcut_to_name[i++]);
}