summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2011-09-08 12:00:49 +0000
committerokan <okan>2011-09-08 12:00:49 +0000
commit840323558d6b6e2b32df27232a0ebe66c45d6952 (patch)
tree24859ab62beee178835c223775e002949fb278e6
parentd85b3adc0c77fb932927671cd0a473885a975c3e (diff)
downloadcwm-840323558d6b6e2b32df27232a0ebe66c45d6952.tar.gz
cwm-840323558d6b6e2b32df27232a0ebe66c45d6952.tar.xz
cwm-840323558d6b6e2b32df27232a0ebe66c45d6952.zip
reinit menu on reload; from Alexander Polakov. needed for catching
upcoming menu config changes.

ok oga@
-rw-r--r--conf.c1
-rw-r--r--menu.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/conf.c b/conf.c
index 5c921a4..e2263b0 100644
--- a/conf.c
+++ b/conf.c
@@ -100,6 +100,7 @@ conf_reload(struct conf *c)
 		conf_gap(c, sc);
 		conf_color(c, sc);
 		conf_font(c, sc);
+		menu_init(sc);
 	}
 	TAILQ_FOREACH(cc, &Clientq, entry)
 		client_draw_border(cc);
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);
 }