summary refs log tree commit diff
path: root/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/menu.c b/menu.c
index 072da10..fdeeee4 100644
--- a/menu.c
+++ b/menu.c
@@ -76,6 +76,8 @@ menu_init(struct screen_ctx *sc)
 {
 	XGCValues	 gv;
 
+	if (sc->menuwin)
+		XDestroyWindow(X_Dpy, sc->menuwin);
 	sc->menuwin = XCreateSimpleWindow(X_Dpy, sc->rootwin, 0, 0, 1, 1,
 	    Conf.bwidth,
 	    sc->color[CWM_COLOR_FG_MENU].pixel,
@@ -86,6 +88,8 @@ menu_init(struct screen_ctx *sc)
 	gv.background = sc->color[CWM_COLOR_BG_MENU].pixel;
 	gv.function = GXxor;
 
+	if (sc->gc)
+		XFreeGC(X_Dpy, sc->gc);
 	sc->gc = XCreateGC(X_Dpy, sc->menuwin,
 	    GCForeground|GCBackground|GCFunction, &gv);
 }