Invalidate cached pixmaps on reload and redraw.

After a reload, the drawing parameters for the decorations might
have changed, so we need to invalidate the cache and force a redraw
of the currently visible decorations. Also, don't leak the previous
font when reloading by freeing it before parsing the config.
This commit is contained in:
Fernando Tarlá Cardoso Lemos
2011-11-23 21:12:36 -02:00
committed by Michael Stapelberg
parent 67c2c03f76
commit 340592a532
5 changed files with 39 additions and 11 deletions

View File

@ -320,6 +320,14 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
TAILQ_FOREACH(ws, workspaces, workspaces)
workspace_set_name(ws, NULL);
#endif
/* Invalidate pixmap caches in case font or colors changed */
Con *con;
TAILQ_FOREACH(con, &all_cons, all_cons)
FREE(con->deco_render_params);
/* Get rid of the current font */
free_font();
}
SLIST_INIT(&modes);
@ -374,6 +382,13 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
set_font(&config.font);
}
/* Redraw the currently visible decorations on reload, so that
* the possibly new drawing parameters changed. */
if (reload) {
x_deco_recurse(croot);
xcb_flush(conn);
}
#if 0
/* Set an empty name for every workspace which got no name */
Workspace *ws;