mirror of
https://github.com/swaywm/sway.git
synced 2026-04-25 06:46:24 -04:00
Don't use title content in size calculations
This prevents distracting screen flashing and seems to work fine for larger glyphs as well (Tested with Japanese). This is perhaps not the best solution, but it's much less noticeable than the current behaviour. Fixes #4992
This commit is contained in:
parent
55016729a5
commit
dc76c52c30
1 changed files with 9 additions and 1 deletions
|
|
@ -513,8 +513,16 @@ void container_calculate_title_height(struct sway_container *container) {
|
|||
cairo_t *cairo = cairo_create(NULL);
|
||||
int height;
|
||||
int baseline;
|
||||
get_text_size(cairo, config->font, NULL, &height, &baseline, 1,
|
||||
/* Calculate height using regular ASCII characters and allow larger glyphs to
|
||||
* "leak" into the margins. This avoids distracting height changes if switching
|
||||
* between containers that have differently sized text.
|
||||
* Larger characters might get cut off, but affected users can work around it by
|
||||
* increasing the title margins */
|
||||
get_text_size(cairo, config->font, NULL, &height, NULL, 1,
|
||||
config->pango_markup, "%s", "ASCII Baseline");
|
||||
get_text_size(cairo, config->font, NULL, NULL, &baseline, 1,
|
||||
config->pango_markup, "%s", container->formatted_title);
|
||||
|
||||
cairo_destroy(cairo);
|
||||
container->title_height = height;
|
||||
container->title_baseline = baseline;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue