mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
tidy up startup/init routines
ok oga@
This commit is contained in:
parent
bcc0f73bb6
commit
b13d592c57
10
calmwm.c
10
calmwm.c
@ -69,13 +69,15 @@ main(int argc, char **argv)
|
|||||||
if (signal(SIGCHLD, sigchld_cb) == SIG_ERR)
|
if (signal(SIGCHLD, sigchld_cb) == SIG_ERR)
|
||||||
err(1, "signal");
|
err(1, "signal");
|
||||||
|
|
||||||
group_init();
|
|
||||||
|
|
||||||
Starting = 1;
|
Starting = 1;
|
||||||
dpy_init(display_name);
|
dpy_init(display_name);
|
||||||
|
|
||||||
|
screen_init();
|
||||||
|
group_init();
|
||||||
|
client_init();
|
||||||
|
|
||||||
bzero(&Conf, sizeof(Conf));
|
bzero(&Conf, sizeof(Conf));
|
||||||
conf_setup(&Conf, conf_file);
|
conf_setup(&Conf, conf_file);
|
||||||
client_setup();
|
|
||||||
xu_getatoms();
|
xu_getatoms();
|
||||||
x_setup();
|
x_setup();
|
||||||
Starting = 0;
|
Starting = 0;
|
||||||
@ -99,8 +101,6 @@ dpy_init(const char *dpyname)
|
|||||||
XSetErrorHandler(x_errorhandler);
|
XSetErrorHandler(x_errorhandler);
|
||||||
|
|
||||||
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
|
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
|
||||||
|
|
||||||
TAILQ_INIT(&Screenq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
3
calmwm.h
3
calmwm.h
@ -328,7 +328,7 @@ int x_errorhandler(Display *, XErrorEvent *);
|
|||||||
__dead void usage(void);
|
__dead void usage(void);
|
||||||
|
|
||||||
struct client_ctx *client_find(Window);
|
struct client_ctx *client_find(Window);
|
||||||
void client_setup(void);
|
void client_init(void);
|
||||||
struct client_ctx *client_new(Window, struct screen_ctx *, int);
|
struct client_ctx *client_new(Window, struct screen_ctx *, int);
|
||||||
int client_delete(struct client_ctx *);
|
int client_delete(struct client_ctx *);
|
||||||
void client_setactive(struct client_ctx *, int);
|
void client_setactive(struct client_ctx *, int);
|
||||||
@ -395,6 +395,7 @@ void *xmalloc(size_t);
|
|||||||
void *xcalloc(size_t, size_t);
|
void *xcalloc(size_t, size_t);
|
||||||
char *xstrdup(const char *);
|
char *xstrdup(const char *);
|
||||||
|
|
||||||
|
void screen_init(void);
|
||||||
struct screen_ctx *screen_fromroot(Window);
|
struct screen_ctx *screen_fromroot(Window);
|
||||||
struct screen_ctx *screen_current(void);
|
struct screen_ctx *screen_current(void);
|
||||||
void screen_updatestackingorder(void);
|
void screen_updatestackingorder(void);
|
||||||
|
2
client.c
2
client.c
@ -27,7 +27,7 @@ static char emptystring[] = "";
|
|||||||
struct client_ctx *_curcc = NULL;
|
struct client_ctx *_curcc = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
client_setup(void)
|
client_init(void)
|
||||||
{
|
{
|
||||||
TAILQ_INIT(&Clientq);
|
TAILQ_INIT(&Clientq);
|
||||||
}
|
}
|
||||||
|
6
screen.c
6
screen.c
@ -24,6 +24,12 @@
|
|||||||
extern struct screen_ctx_q Screenq;
|
extern struct screen_ctx_q Screenq;
|
||||||
extern struct screen_ctx *Curscreen;
|
extern struct screen_ctx *Curscreen;
|
||||||
|
|
||||||
|
void
|
||||||
|
screen_init(void)
|
||||||
|
{
|
||||||
|
TAILQ_INIT(&Screenq);
|
||||||
|
}
|
||||||
|
|
||||||
struct screen_ctx *
|
struct screen_ctx *
|
||||||
screen_fromroot(Window rootwin)
|
screen_fromroot(Window rootwin)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user