cvsimport

This commit is contained in:
okan 2014-10-08 15:31:01 +00:00
commit 501aa2bcf3
3 changed files with 19 additions and 17 deletions

View File

@ -221,9 +221,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);
@ -429,7 +429,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 *);

25
group.c
View File

@ -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]);
TAILQ_INIT(&gc->clientq); gc->num = num;
gc->name = xstrdup(num_to_name[i]); TAILQ_INIT(&gc->clientq);
gc->num = i;
TAILQ_INSERT_TAIL(&sc->groupq, gc, entry); TAILQ_INSERT_TAIL(&sc->groupq, gc, entry);
if (i == 1)
group_setactive(gc); if (num == 1)
} 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;

View File

@ -38,7 +38,7 @@ screen_init(int which)
XSetWindowAttributes rootattr; XSetWindowAttributes rootattr;
unsigned int nwins, i; unsigned int nwins, i;
sc = xcalloc(1, sizeof(*sc)); sc = xmalloc(sizeof(*sc));
TAILQ_INIT(&sc->clientq); TAILQ_INIT(&sc->clientq);
TAILQ_INIT(&sc->regionq); TAILQ_INIT(&sc->regionq);
@ -48,13 +48,16 @@ screen_init(int which)
sc->rootwin = RootWindow(X_Dpy, sc->which); sc->rootwin = RootWindow(X_Dpy, sc->which);
sc->cycling = 0; sc->cycling = 0;
sc->hideall = 0; sc->hideall = 0;
conf_screen(sc); conf_screen(sc);
xu_ewmh_net_supported(sc); xu_ewmh_net_supported(sc);
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);