From 62d90a8e959c6edcc752e124a9928cfa2399fbd1 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Wed, 18 Aug 2021 23:27:01 +0200 Subject: Use fixed titlebar heights Use fixed titlebar heights. The default height is calculated based on font metrics for the configured font and current locale. Some testing with titles with emoji and CJK characters (which are substantially higher in my setup) shows that the titlebars retain their initial value, text does shift up or down, and all titlebars always remain aligned. Also drop some also now-unecessary title_height calculations. Makes also needed to be updated, since they should be positioned with the same rules. --- include/sway/config.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'include/sway/config.h') diff --git a/include/sway/config.h b/include/sway/config.h index b8327e9c..d6c29fe6 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -486,8 +486,8 @@ struct sway_config { enum sway_container_layout default_orientation; enum sway_container_layout default_layout; char *font; - size_t font_height; - size_t font_baseline; + int font_height; + int font_baseline; bool pango_markup; int titlebar_border_thickness; int titlebar_h_padding; @@ -696,14 +696,13 @@ void free_bar_binding(struct bar_binding *binding); void free_workspace_config(struct workspace_config *wsc); /** - * Updates the value of config->font_height based on the max title height - * reported by each container. If recalculate is true, the containers will - * recalculate their heights before reporting. - * + * Updates the value of config->font_height based on the metrics for title's + * font as reported by pango. + * * If the height has changed, all containers will be rearranged to take on the * new size. */ -void config_update_font_height(bool recalculate); +void config_update_font_height(void); /** * Convert bindsym into bindcode using the first configured layout. -- cgit v1.2.3-54-g00ecf