GNOME Bugzilla – Bug 769898
window: Fix CSD size calculations with long titles
Last modified: 2016-09-04 12:32:12 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.
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>
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 on attachment 333296 [details] [review] window: Fix CSD size calculations with long titles Thanks!
Pushed it myself to make it into 3.21.90.
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).
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.
Patch reverted.
Egmont can you add the debug output of gnome-terminal when this happens (to see what it calculates as CSD etc)?
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>
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
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!
Pushed to master.