GNOME Bugzilla – Bug 670496
Zenity info/error windows grow in height with message length
Last modified: 2017-03-19 16:06:52 UTC
When I create a message window with a long-ish (only needs to be maybe one line long) message, the window height gets rather large, unnecessarily. Reproduce: Try zenity --info --text="message" & zenity --info --text="a slightly longer message, but not all that long." Look at the windows produced - they both only have one line of text, but the window height is growing. Doing this with a longer message still only makes it worse, I end up with a window with a massive big blank patch between the message and the bottom of the window. I have access to another machine with v2.3 installed - that is fine. Sorry, I don't have any other versions to check against just now. Someone has also put up a bug report at redhat: https://bugzilla.redhat.com/show_bug.cgi?id=754431 There are images attached to that report showing the problem. I am running Debian unstable.
I can reproduce this bug on Debian Wheezy (Zenity 3.4.0) and sid (Zenity 3.12.1). A patch has been proposed on bug #702295 on the Debian bug tracker: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=fix-whitespacing-box-sizes;att=1;bug=702295 This patch fixes the problem for me. Can any Zenity maintainer please have a look and evaluate this patch? JFTR, this has also been reported a few times in Ubuntu: https://bugs.launchpad.net/ubuntu/+source/zenity/+bug/1206760 https://bugs.launchpad.net/ubuntu/+source/zenity/+bug/1273981 https://bugs.launchpad.net/ubuntu/+source/zenity/+bug/1166257 https://bugs.launchpad.net/ubuntu/+source/zenity/+bug/1087520
Hello, Thanks! I'm investigating this.
SO, this patch adds the ellipsize option as default in zenity. I add a option --elipsize in zenity to have this same behavior. I believe it's better because won't broke old scripts. What do you guys think? Here's the patch: https://git.gnome.org/browse/zenity/commit/?id=ec0c2f3292b3db0fdad7f02ed068a97b66f7a2ea
(In reply to comment #3) > I believe it's better because > won't broke old scripts. What do you guys think? I'm not sure the risk of breaking old scripts is greater than the advantage of fixing old, past and future ones. But that's your call :)
https://git.gnome.org/browse/zenity/commit/?id=e5eb127e9779b9a58e53b1a7d268b81284ebd241 fix the problem :D
Hi! I've applied ec0c2f3 and e5eb127e on top of zenity 3.12.1, tested on current Debian sid, and I confirm this nicely fixes the problem for me (without using --ellipsize). Thanks a lot! But then, is the --ellipsize option really needed?
Do you think a new release could be done?
Zenity 3.22.0 has this issue again. Using --no-wrap works around the height wild grow. Would you reopen this bug (which I didn't find how to do myself) or should I report an other one?
While investigating the issue with GTK Inspector, I found that the label has the right height, but the dialog is too heigh. It turns out that the gtk_widget_set_size_request (widget, allocation->width/2, -1); made in zenity_text_size_allocate has no effect anymore. Commenting it out doesn't change anything, and with very long text the label fits the entire window width, while it should only fit half of it. The code in zenity doens't seem to have changed. Could this be a bug in GTK?
I think the issue is indeed in GTK, or at least related to a change in GTK: zenity 3.22.0 built with GTK 3.14.5-1+deb8u1 doesn't have the issue. The same zenity built with GTK 3.22.9-3 has the issue. I let you decide if the issue should be fixed in GTK or if zenity should be adapted.
The bug in GTK seems to be https://bugzilla.gnome.org/show_bug.cgi?id=657621. Unfortunately the documented workaround apparently stopped working.
Created attachment 348220 [details] [review] [PATCH] Fix message dialog width and height on recent Gtk
Alan: I suggest you file the new, buggy behavior as a new bug. While the resulting behavior is the same, the root cause is different, so IMO it'll be easier to understand the status of this problem if it has a dedicated bug report.
(Also, the new bug report should mention the _width_ problems as well.)
Hello, Can you please open a new bug, and mention this one, as @intrigeri said? I plan to work on this once the hard code freeze ends next week. And thanks for the patch as well.
> Can you please open a new bug, and mention this one Done as https://bugzilla.gnome.org/show_bug.cgi?id=780268