From 2f671ecd12558466c3b0f38604dedf5f2fab2e59 Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 8 Sep 2011 12:00:49 +0000 Subject: reinit menu on reload; from Alexander Polakov. needed for catching upcoming menu config changes. ok oga@ --- menu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'menu.c') diff --git a/menu.c b/menu.c index 27f628c..79b283d 100644 --- a/menu.c +++ b/menu.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: menu.c,v 1.32 2011/07/25 15:41:05 okan Exp $ + * $OpenBSD: menu.c,v 1.33 2011/09/08 12:00:50 okan Exp $ */ #include @@ -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); } -- cgit v1.2.3-2-gb3c3