reinit menu on reload; from Alexander Polakov. needed for catching

upcoming menu config changes.

ok oga@
This commit is contained in:
okan 2011-09-08 12:00:49 +00:00
parent d85b3adc0c
commit 840323558d
2 changed files with 5 additions and 0 deletions

1
conf.c
View File

@ -100,6 +100,7 @@ conf_reload(struct conf *c)
conf_gap(c, sc); conf_gap(c, sc);
conf_color(c, sc); conf_color(c, sc);
conf_font(c, sc); conf_font(c, sc);
menu_init(sc);
} }
TAILQ_FOREACH(cc, &Clientq, entry) TAILQ_FOREACH(cc, &Clientq, entry)
client_draw_border(cc); client_draw_border(cc);

4
menu.c
View File

@ -76,6 +76,8 @@ menu_init(struct screen_ctx *sc)
{ {
XGCValues gv; XGCValues gv;
if (sc->menuwin)
XDestroyWindow(X_Dpy, sc->menuwin);
sc->menuwin = XCreateSimpleWindow(X_Dpy, sc->rootwin, 0, 0, 1, 1, sc->menuwin = XCreateSimpleWindow(X_Dpy, sc->rootwin, 0, 0, 1, 1,
Conf.bwidth, Conf.bwidth,
sc->color[CWM_COLOR_FG_MENU].pixel, 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.background = sc->color[CWM_COLOR_BG_MENU].pixel;
gv.function = GXxor; gv.function = GXxor;
if (sc->gc)
XFreeGC(X_Dpy, sc->gc);
sc->gc = XCreateGC(X_Dpy, sc->menuwin, sc->gc = XCreateGC(X_Dpy, sc->menuwin,
GCForeground|GCBackground|GCFunction, &gv); GCForeground|GCBackground|GCFunction, &gv);
} }