Rect con_deco_rect;
uint32_t background;
bool con_is_leaf;
- xcb_font_t font;
};
/**
*/
i3Font load_font(const char *pattern, const bool fallback);
+/**
+ * Defines the font to be used for the forthcoming calls.
+ *
+ */
+void set_font(i3Font *font);
+
+/**
+ * Frees the resources taken by the current font.
+ *
+ */
+void free_font();
+
/**
* Converts the given string to UTF-8 from UCS-2 big endian. The return value
* must be freed after use.
*/
xcb_char2b_t *convert_utf8_to_ucs2(char *input, size_t *real_strlen);
-/**
- * Defines the font to be used for the forthcoming draw_text and
- * predict_text_width calls.
- *
- */
-void set_font(i3Font *font);
-
/**
* Defines the colors to be used for the forthcoming draw_text calls.
*
}
/*
- * 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.
*
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);
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;
p->con_deco_rect = con->deco_rect;
p->background = config.client.background;
p->con_is_leaf = con_is_leaf(con);
- p->font = config.font.id;
if (con->deco_render_params != NULL &&
(con->window == NULL || !con->window->name_x_changed) &&