aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
authorLibravatar Hugo Osvaldo Barrera <hugo@barrera.io>2021-08-18 23:27:01 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2021-08-26 20:16:14 +0200
commit62d90a8e959c6edcc752e124a9928cfa2399fbd1 (patch)
treed7f26db04a7a57b3b304768631348e8450197ba4 /sway/desktop/render.c
parentUpdate Pango font description URL in sway.5.scd (diff)
downloadsway-62d90a8e959c6edcc752e124a9928cfa2399fbd1.tar.gz
sway-62d90a8e959c6edcc752e124a9928cfa2399fbd1.tar.zst
sway-62d90a8e959c6edcc752e124a9928cfa2399fbd1.zip
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.
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index a5bd8a5f..d25df570 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -559,8 +559,7 @@ static void render_titlebar(struct sway_output *output,
559 559
560 // The title texture might be shorter than the config->font_height, 560 // The title texture might be shorter than the config->font_height,
561 // in which case we need to pad it above and below. 561 // in which case we need to pad it above and below.
562 int ob_padding_above = round((config->font_baseline - 562 int ob_padding_above = round((titlebar_v_padding -
563 con->title_baseline + titlebar_v_padding -
564 titlebar_border_thickness) * output_scale); 563 titlebar_border_thickness) * output_scale);
565 int ob_padding_below = ob_bg_height - ob_padding_above - 564 int ob_padding_below = ob_bg_height - ob_padding_above -
566 texture_box.height; 565 texture_box.height;