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:
committed by
Michael Stapelberg
parent
67c2c03f76
commit
340592a532
14
libi3/font.c
14
libi3/font.c
@ -73,14 +73,24 @@ i3Font load_font(const char *pattern, const bool fallback) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Defines the font to be used for the forthcoming draw_text and
|
||||
* predict_text_width calls.
|
||||
* Defines the font to be used for the forthcoming calls.
|
||||
*
|
||||
*/
|
||||
void set_font(i3Font *font) {
|
||||
savedFont = font;
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees the resources taken by the current font.
|
||||
*
|
||||
*/
|
||||
void free_font() {
|
||||
/* Close the font and free the info */
|
||||
xcb_close_font(conn, savedFont->id);
|
||||
if (savedFont->info)
|
||||
free(savedFont->info);
|
||||
}
|
||||
|
||||
/*
|
||||
* Defines the colors to be used for the forthcoming draw_text calls.
|
||||
*
|
||||
|
Reference in New Issue
Block a user