Skip to content

Fix window titles unexpectedly getting truncated

Sergey Bugaev requested to merge bugaevc/gtk:fix-title-truncation into main

Updating a Pango context can influence the layout of widget, in particular that of a GtkLabel, not only its rendering. Make sure to queue a resize when updating the context.

In particular, this fixes window titles getting suddenly truncated when moving a window from a HiDPI display to a low DPI one, after !6190 (merged) has made font hinting depend on the widget scale. With hinting enabled on low DPI, the Pango layout needs ever so slightly more width to not get truncated. There is plenty of space in the header bar that could be allocated to the label, but for that to happen, it needs to know to queue a resize.


Screenshot_from_2023-10-11_15-41-04

Merge request reports