diff options
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); } |