aboutsummaryrefslogtreecommitdiffstats
path: root/group.c
diff options
context:
space:
mode:
authorokan2013-01-01 14:19:56 +0000
committerokan2013-01-01 14:19:56 +0000
commit04e1c4d4ec08c96fbc13dfb72f061b1845f9b785 (patch)
treed384c0e3da111c126fad8976256719605a2946aa /group.c
parentc5eb66fdce461930b3b780e5f09b0f3771474825 (diff)
downloadcwm-04e1c4d4ec08c96fbc13dfb72f061b1845f9b785.tar.gz
make num of groups no longer off-by-one; from Alexander Polakov
note that a re-exec of cwm will not rewrite the group number atom of *existing* clients, so they will remain off-by-one until each client has its atom updated, or of course a restart of X.
Diffstat (limited to 'group.c')
-rw-r--r--group.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/group.c b/group.c
index 35e0574..99d6722 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.66 2012/12/17 17:48:57 okan Exp $
+ * $OpenBSD: group.c,v 1.67 2013/01/01 14:19:56 okan Exp $
*/
#include <sys/param.h>
@@ -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);
}
@@ -327,7 +327,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 +420,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 +480,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++]);
}