After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769898 - window: Fix CSD size calculations with long titles
window: Fix CSD size calculations with long titles
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-14 20:55 UTC by Sjoerd Simons
Modified: 2016-09-04 12:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: Fix CSD size calculations with long titles (4.01 KB, patch)
2016-08-14 20:55 UTC, Sjoerd Simons
none Details | Review
window: Fix CSD size calculations with long titles (4.53 KB, patch)
2016-08-21 18:28 UTC, Sjoerd Simons
none Details | Review

Description Sjoerd Simons 2016-08-14 20:55:05 UTC
Whenever my gnome-terminal title no longer fits in my titlebar (i've got he
cwd as part of the title) the terminal gets one column smaller on ever new
line.. Seemingly this is due to the CSD calculation being thrown of.
Comment 1 Sjoerd Simons 2016-08-14 20:55:09 UTC
Created attachment 333296 [details] [review]
window: Fix CSD size calculations with long titles

To get the size of the window use the actual allocation rather then the
preferred size as the latter takes into account the natural size of the
title bar as well as the content which throws of calculation when the
natural size of the title bar is wider then the contnet.

Signed-off-by: Sjoerd Simons <sjoerd@luon.net>
Comment 2 Simon McVittie 2016-08-15 12:49:39 UTC
Review of attachment 333296 [details] [review]:

I am not a gnome-terminal maintainer, but this makes perfect sense to me. We already recalculate when the window gets realized.
Comment 3 Christian Persch 2016-08-15 16:50:18 UTC
Comment on attachment 333296 [details] [review]
window: Fix CSD size calculations with long titles

Thanks!
Comment 4 Christian Persch 2016-08-15 18:25:35 UTC
Pushed it myself to make it into 3.21.90.
Comment 5 Egmont Koblinger 2016-08-16 23:41:20 UTC
Reopening.

This change introduced a severe regression, making g-t pretty much unusable at certain setups.

With at least 2 tabs open, whenever the tab title is changed the window's height decreases by a row.

(With Ubuntu's default config this happens each time the shell prompt is printed.)

I'm on vte/g-t git master, the rest is stock Ubuntu 16.04 (e.g. gtk+-3.18.9).
Comment 6 Egmont Koblinger 2016-08-16 23:43:42 UTC
Note: This is on Ubuntu's default Unity 7 desktop environment. Not sure how CSD comes into the game, it uses old-fashioned server-side decoration for g-t.
Comment 7 Christian Persch 2016-08-17 06:20:47 UTC
Patch reverted.
Comment 8 Sjoerd Simons 2016-08-17 07:25:50 UTC
Egmont can you add the debug output of gnome-terminal when this happens (to see what it calculates as CSD etc)?
Comment 9 Sjoerd Simons 2016-08-21 18:28:53 UTC
Created attachment 333833 [details] [review]
window: Fix CSD size calculations with long titles

To get the size of the window use the actual allocation rather then the
preferred size as the latter takes into account the natural size of the
title bar as well as the content which throws of calculation when the
natural size of the title bar is wider then the content.

Also use the actual allocation of the content specifically for the
calculation of the CSD size such that both are in sync, but keep using
the preferred size otherwise as those values get used for resizing
calculations.

Signed-off-by: Sjoerd Simons <sjoerd@luon.net>
Comment 10 Sjoerd Simons 2016-08-21 18:30:11 UTC
Regressions caused by the previous patch were due to using the preferred size of the content but the actual allocation of the window. Apparently when not using CSD those go out of sync causing issues, using the actual allocation for both returns sanity
Comment 11 Egmont Koblinger 2016-08-21 18:41:52 UTC
Sorry, didn't have time to debug the previous patch. The new one seems to be okay for me (that is, no obvious regression on my system after using for 10 seconds). Thanks!
Comment 12 Christian Persch 2016-09-04 12:32:12 UTC
Pushed to master.