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 670496 - Zenity info/error windows grow in height with message length
Zenity info/error windows grow in height with message length
Product: zenity
Classification: Core
Component: general
Other Linux
: Normal normal
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
Depends on:
Reported: 2012-02-21 02:58 UTC by lx_op
Modified: 2017-03-19 16:06 UTC
See Also:
GNOME target: ---
GNOME version: ---

[PATCH] Fix message dialog width and height on recent Gtk (2.29 KB, patch)
2017-03-18 10:59 UTC, Alan
none Details | Review

Description lx_op 2012-02-21 02:58:03 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.

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:
There are images attached to that report showing the problem.

I am running Debian unstable.
Comment 1 intrigeri 2014-05-25 16:40:56 UTC
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:;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:
Comment 2 Arx Cruz 2014-05-25 17:32:18 UTC

Thanks! I'm investigating this.
Comment 3 Arx Cruz 2014-05-25 17:49:29 UTC
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:
Comment 4 intrigeri 2014-05-28 15:13:27 UTC
(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 :)
Comment 6 intrigeri 2014-06-07 13:44:19 UTC
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?
Comment 7 Laurent Bigonville 2014-06-17 08:37:17 UTC
Do you think a new release could be done?
Comment 8 Alan 2017-03-17 12:17:59 UTC
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?
Comment 9 Alan 2017-03-17 15:59:21 UTC
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?
Comment 10 Alan 2017-03-17 16:53:03 UTC
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.
Comment 11 Alan 2017-03-17 21:08:42 UTC
The bug in GTK seems to be Unfortunately the documented workaround apparently stopped working.
Comment 12 Alan 2017-03-18 10:59:35 UTC
Created attachment 348220 [details] [review]
[PATCH] Fix message dialog width and height on recent Gtk
Comment 13 intrigeri 2017-03-18 15:26:38 UTC
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.
Comment 14 intrigeri 2017-03-18 15:28:41 UTC
(Also, the new bug report should mention the _width_ problems as well.)
Comment 15 Arx Cruz 2017-03-18 17:32:13 UTC

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.
Comment 16 Alan 2017-03-19 16:06:52 UTC
> Can you please open a new bug, and mention this one

Done as