diff options
author | okan | 2011-09-08 12:00:49 +0000 |
---|---|---|
committer | okan | 2011-09-08 12:00:49 +0000 |
commit | 2f671ecd12558466c3b0f38604dedf5f2fab2e59 (patch) | |
tree | 5ed136d004a1b39ac6747afb11a8153077873ab8 /menu.c | |
parent | 6ddb274724b404adf7d7bd33dae5ebb383784375 (diff) | |
download | cwm-2f671ecd12558466c3b0f38604dedf5f2fab2e59.tar.gz |
reinit menu on reload; from Alexander Polakov. needed for catching
upcoming menu config changes.
ok oga@
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 <sys/param.h> @@ -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); } |