summaryrefslogtreecommitdiff
path: root/app/cwm/calmwm.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2009-04-15 14:01:46 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2009-04-15 14:01:46 +0000
commit2850366d21e546e21590af9e37ef3407eef47f59 (patch)
tree400b6d423b94f3e5b27493c30e17f8e45c919dd2 /app/cwm/calmwm.c
parente4224221d625e4273011ca768952a852905148c9 (diff)
properly teardown X connection upon quit; static a few while here,
requested by oga@ ok oga@ sometime ago
Diffstat (limited to 'app/cwm/calmwm.c')
-rw-r--r--app/cwm/calmwm.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c
index 953faab75..a23e72610 100644
--- a/app/cwm/calmwm.c
+++ b/app/cwm/calmwm.c
@@ -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;