diff options
author | okan | 2009-04-15 14:01:45 +0000 |
---|---|---|
committer | okan | 2009-04-15 14:01:45 +0000 |
commit | f6aa4602b88478c1e947f4e7add29dfb36584d41 (patch) | |
tree | e8f7a0ed52239f7dc3ded947a45884d5b230d8c9 | |
parent | 0e828a44581234d95d230d250fd72b767f597360 (diff) | |
download | cwm-f6aa4602b88478c1e947f4e7add29dfb36584d41.tar.gz |
properly teardown X connection upon quit; static a few while here,
requested by oga@
ok oga@ sometime ago
-rw-r--r-- | calmwm.c | 18 | ||||
-rw-r--r-- | calmwm.h | 4 |
2 files changed, 18 insertions, 4 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: calmwm.c,v 1.35 2009/01/27 02:16:20 okan Exp $ + * $Id: calmwm.c,v 1.36 2009/04/15 14:01:45 okan Exp $ */ #include "headers.h" @@ -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; @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: calmwm.h,v 1.83 2009/02/07 21:07:00 martynas Exp $ + * $Id: calmwm.h,v 1.84 2009/04/15 14:01:45 okan Exp $ */ #ifndef _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); |