mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
make group_init work like other *_init's
This commit is contained in:
parent
e9dbd150ea
commit
836c9f49d6
4
calmwm.h
4
calmwm.h
@ -202,9 +202,9 @@ TAILQ_HEAD(client_ctx_q, client_ctx);
|
|||||||
struct group_ctx {
|
struct group_ctx {
|
||||||
TAILQ_ENTRY(group_ctx) entry;
|
TAILQ_ENTRY(group_ctx) entry;
|
||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
struct client_ctx_q clientq;
|
|
||||||
char *name;
|
char *name;
|
||||||
int num;
|
int num;
|
||||||
|
struct client_ctx_q clientq;
|
||||||
};
|
};
|
||||||
TAILQ_HEAD(group_ctx_q, group_ctx);
|
TAILQ_HEAD(group_ctx_q, group_ctx);
|
||||||
|
|
||||||
@ -410,7 +410,7 @@ void group_hide(struct group_ctx *);
|
|||||||
void group_hidetoggle(struct screen_ctx *, int);
|
void group_hidetoggle(struct screen_ctx *, int);
|
||||||
int group_holds_only_hidden(struct group_ctx *);
|
int group_holds_only_hidden(struct group_ctx *);
|
||||||
int group_holds_only_sticky(struct group_ctx *);
|
int group_holds_only_sticky(struct group_ctx *);
|
||||||
void group_init(struct screen_ctx *);
|
void group_init(struct screen_ctx *, int);
|
||||||
void group_movetogroup(struct client_ctx *, int);
|
void group_movetogroup(struct client_ctx *, int);
|
||||||
void group_only(struct screen_ctx *, int);
|
void group_only(struct screen_ctx *, int);
|
||||||
void group_show(struct group_ctx *);
|
void group_show(struct group_ctx *);
|
||||||
|
17
group.c
17
group.c
@ -114,24 +114,23 @@ group_restack(struct group_ctx *gc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
group_init(struct screen_ctx *sc)
|
group_init(struct screen_ctx *sc, int num)
|
||||||
{
|
{
|
||||||
struct group_ctx *gc;
|
struct group_ctx *gc;
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < CALMWM_NGROUPS; i++) {
|
gc = xmalloc(sizeof(*gc));
|
||||||
gc = xcalloc(1, sizeof(*gc));
|
|
||||||
gc->sc = sc;
|
gc->sc = sc;
|
||||||
|
gc->name = xstrdup(num_to_name[num]);
|
||||||
|
gc->num = num;
|
||||||
TAILQ_INIT(&gc->clientq);
|
TAILQ_INIT(&gc->clientq);
|
||||||
gc->name = xstrdup(num_to_name[i]);
|
|
||||||
gc->num = i;
|
|
||||||
TAILQ_INSERT_TAIL(&sc->groupq, gc, entry);
|
TAILQ_INSERT_TAIL(&sc->groupq, gc, entry);
|
||||||
if (i == 1)
|
|
||||||
|
if (num == 1)
|
||||||
group_setactive(gc);
|
group_setactive(gc);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
group_setactive(struct group_ctx *gc)
|
group_setactive(struct group_ctx *gc)
|
||||||
{
|
{
|
||||||
struct screen_ctx *sc = gc->sc;
|
struct screen_ctx *sc = gc->sc;
|
||||||
|
4
screen.c
4
screen.c
@ -54,7 +54,9 @@ screen_init(int which)
|
|||||||
xu_ewmh_net_supported_wm_check(sc);
|
xu_ewmh_net_supported_wm_check(sc);
|
||||||
|
|
||||||
screen_update_geometry(sc);
|
screen_update_geometry(sc);
|
||||||
group_init(sc);
|
|
||||||
|
for (i = 0; i < CALMWM_NGROUPS; i++)
|
||||||
|
group_init(sc, i);
|
||||||
|
|
||||||
xu_ewmh_net_desktop_names(sc);
|
xu_ewmh_net_desktop_names(sc);
|
||||||
xu_ewmh_net_wm_desktop_viewport(sc);
|
xu_ewmh_net_wm_desktop_viewport(sc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user