diff options
author | okan <okan> | 2009-04-15 14:01:45 +0000 |
---|---|---|
committer | okan <okan> | 2009-04-15 14:01:45 +0000 |
commit | ea96e92ac8ab68439f7cafa294e3905818324960 (patch) | |
tree | c5046b9d469dec7388cd4326e0e60e05ec421594 | |
parent | 8a490fc270f961a30dadd8b0cb29c09d88c5554d (diff) | |
download | cwm-ea96e92ac8ab68439f7cafa294e3905818324960.tar.gz cwm-ea96e92ac8ab68439f7cafa294e3905818324960.tar.xz cwm-ea96e92ac8ab68439f7cafa294e3905818324960.zip |
properly teardown X connection upon quit; static a few while here,
requested by oga@ ok oga@ sometime ago
-rw-r--r-- | calmwm.c | 16 | ||||
-rw-r--r-- | calmwm.h | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/calmwm.c b/calmwm.c index 843db62..36aa533 100644 --- a/calmwm.c +++ b/calmwm.c @@ -40,6 +40,9 @@ struct conf Conf; static void _sigchld_cb(int); static void dpy_init(const char *); +static void x_setup(void); +static void x_setupscreen(struct screen_ctx *, u_int); +static void x_teardown(void); int main(int argc, char **argv) @@ -97,6 +100,8 @@ main(int argc, char **argv) xev_loop(); + x_teardown(); + return (0); } @@ -144,6 +149,17 @@ x_setup(void) } void +x_teardown(void) +{ + struct screen_ctx *sc; + + TAILQ_FOREACH(sc, &Screenq, entry) + XFreeGC(X_Dpy, sc->gc); + + XCloseDisplay(X_Dpy); +} + +void x_setupscreen(struct screen_ctx *sc, u_int which) { XColor tmp; diff --git a/calmwm.h b/calmwm.h index e84318f..88da71a 100644 --- a/calmwm.h +++ b/calmwm.h @@ -310,8 +310,6 @@ int input_keycodetrans(KeyCode, u_int, enum ctltype *, char *); int x_errorhandler(Display *, XErrorEvent *); -void x_setup(void); -void x_setupscreen(struct screen_ctx *, u_int); __dead void usage(void); struct client_ctx *client_find(Window); |