! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Text in window frame titles is not centered vertically if font DPI set to 140


Description Rinat 2019-10-20 22:45:42 CEST
Created attachment 9136 
Left: after startup, right: after changing theme forth and back.

This happens on xfwm4 4.14.0, and also on current
master (0e91faba6701b4c578fd50f81565d02aaa8ebd09).

When I login and session starts, windows has their title text
slightly moved downwards from center.  Screenshot attached.

And then if I change theme in xfwm4-settings, title text becomes
vertically centered again. Even if I choose the same theme I
started with. It also helps to change DPI in
xfce4-appearance-settings, just increasing and decreasing it
again is enough too.

It's sufficient to set font DPI to 140 in xfce4-appearance-settings
to reproduce the issue. It happens on a clean profile in a clean
installation too. Just non-standard DPI setting causes the title
text to be vertically off-center.

Also found that the following patch fixes the issue on my

diff --git a/src/frame.c b/src/frame.c
index 34d1466bb..709f7c46d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -205,14 +205,8 @@ frameCreateTitlePixmap (Client * c, int state, int left, int right, xfwmPixmap *
     pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
-    title_height = screen_info->font_height;
-    if (!title_height)
-    {
-        /* If for some reason the font height is not known,
-         * use the actual pango layout height.
-         */
-        title_height = logical_rect.height;
-    }
+    title_height = logical_rect.height;
     title_y = voffset + (frameDecorationTop(screen_info) - title_height) / 2;
     if (title_y + title_height > frameDecorationTop(screen_info))

I suspect that screen_info->font_height is somehow keeps the old
value before DPI is updated at startup. Perhaps, some race
condition. Or maybe signal ordering was changed in GTK 3.
Bisecting points to the patch series with GTK 3 migration. The
issue is not present before those patches, and present immediately
Comment 1 haarp 2019-11-11 21:32:46 CET
Can confirm in Xfwm4-4.14.0.

Having also set custom DPI to 142, the window titles will be misaligned after login. Toggling the title font size back and forth fixes it.
Comment 2 Git Bot editbugs 2020-04-05 17:53:38 CEST
Olivier Fourdan referenced this bugreport in commit 34a31e274af2636d7bcb7cba833738ef4ff1be3e

frame: Fix title align

Comment 3 Git Bot editbugs 2020-04-11 17:59:16 CEST
Olivier Fourdan referenced this bugreport in commit 6523626a96545a1901b91f99e18226d014b11adb

frame: Fix title align

Comment 4 Rinat 2020-04-19 00:37:39 CEST
I've just tested on my setup. All current states of master branch, xfce-4.14 branch,
and xfce-4.14.1 tag have the issue fixed. Text is vertically centered.
Comment 5 Git Bot editbugs 2020-04-20 22:40:14 CEST
Olivier Fourdan referenced this bugreport in commit e3bf9ae517a40007bfe92663e3e7ae052f3655f9

frame: Do not use the pre-computed font height

Comment 6 Git Bot editbugs 2020-04-20 22:40:16 CEST
Olivier Fourdan referenced this bugreport in commit 065a12049437200035e052962a2a6064f9a31be8

screen: Remove pre-computed font height

Comment 7 Git Bot editbugs 2020-05-01 17:47:04 CEST
Olivier Fourdan referenced this bugreport in commit d2c453d541a50e856e6e4bdbd6d3badb36b3e3e5

frame: Do not use the pre-computed font height

Comment 8 Git Bot editbugs 2020-05-01 17:47:06 CEST
Olivier Fourdan referenced this bugreport in commit 93c8941c50d2d45d557ed263e3f06ac25ece9fbd

screen: Remove pre-computed font height


Bug #16067

Reported by:
Reported on: 2019-10-20
Last modified on: 2020-05-01


Olivier Fourdan
CC List:
2 users


GIT Master


Additional information