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 673643 - Zenity windows get TOO HIGH when text contains many words
Zenity windows get TOO HIGH when text contains many words
Status: RESOLVED DUPLICATE of bug 670082
Product: zenity
Classification: Core
Component: general
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-06 13:22 UTC by Yann
Modified: 2014-05-29 20:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot illustrating the bug (53.04 KB, image/png)
2012-04-06 13:22 UTC, Yann
Details
label size (46.66 KB, image/png)
2013-05-01 21:25 UTC, Arx Cruz
Details
zenity_big_window.png (11.94 KB, image/png)
2014-05-19 21:22 UTC, Arx Cruz
Details
zenity_ellipsize_start.png (8.02 KB, image/png)
2014-05-19 21:22 UTC, Arx Cruz
Details
zenity_ellipsize_none.png (10.26 KB, image/png)
2014-05-19 21:23 UTC, Arx Cruz
Details
zenity_label.png (10.82 KB, image/png)
2014-05-19 21:23 UTC, Arx Cruz
Details

Description Yann 2012-04-06 13:22:37 UTC
Created attachment 211471 [details]
screenshot illustrating the bug

zenity 3.2 (Ubuntu 11.10 and Fedora16 - https://bugzilla.redhat.com/show_bug.cgi?id=754431 )

--info , --warning , --error windows get higher for each word which is added to the text.
Seems like useless blank lines are added below the text.


HOW TO REPRODUCE:
zenity --info --text='A b c d e f g h i j k l m n o p q r s t u v w x y z'
zenity --warning --text='A b c d e f g h i j k l m n o p q r s t u v w x y z'
zenity --error --text='A b c d e f g h i j k l m n o p q r s t u v w x y z'
zenity --error --text='A-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z'


Examples which DON'T have the bug:
zenity --question --text='A b c d e f g h i j k l m n o p q r s t u v w x y z'
zenity --error --text='A,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z'
Comment 1 Daniel Preston 2012-08-16 09:55:50 UTC
Confirmed, I am having the same bug.
Comment 2 Yann 2012-12-07 00:55:54 UTC
Still valid in Ubuntu12.10 (zenity 3.4.0-2).

This causes severe usability issues for software using Zenity. (eg Boot-Repair)

Please could anybody look at this?
Comment 3 Ronny Standtke 2013-04-24 13:49:19 UTC
I just run into the same issue on Debian 7 (wheezy). Now I have to use kdialog in GNOME, because it seems to be the only dialog implementation that can handle long HTML messages properly. What a bloody mess...
Comment 4 Arx Cruz 2013-04-24 13:53:51 UTC
I will work on this issue (although patches are mostly welcome).
Comment 5 Yann 2013-05-01 20:26:38 UTC
New observation: with --error, the bug is 2x more important than with --info , --warning.
Comment 6 Arx Cruz 2013-05-01 21:25:59 UTC
Created attachment 243012 [details]
label size

The problem here is the line wrap mode. If you see the gtk documentation at:

https://developer.gnome.org/gtk3/stable/GtkLabel.html#gtk-label-set-line-wrap

Says:

Note that setting line wrapping to TRUE does not make the label wrap at its parent container's width, because GTK+ widgets conceptually can't make their requisition depend on the parent container's size. For a label that wraps at a specific position, set the label's width using gtk_widget_set_size_request().

I add a gtk_widget_set_size_request() however it didn't work. It seems that the label's height is exactly the amount necessary to show all the text when the width is small, as you can see in the attachment.

In order to fix it, I need to set the line wrap to false, and if anyone want's to show two or three lines in the dialog must add a \n in their scripts.
Comment 7 Tomáš Hnyk 2014-03-09 20:42:02 UTC
Seems like a reasonable way to solve this, even though it might break some existing scripts?
Comment 8 Arx Cruz 2014-04-18 20:42:34 UTC
This isn't a problem with Zenity, it's a problem with GtkLabel. Check Bug #670082

*** This bug has been marked as a duplicate of bug 670082 ***
Comment 9 dennis123321 2014-05-18 20:55:20 UTC
(In reply to comment #8)
> This isn't a problem with Zenity, it's a problem with GtkLabel. Check Bug
> #670082
> 
> *** This bug has been marked as a duplicate of bug 670082 ***

Did you see reply #5 on bug 670082?

It sounds like he is saying it's only an issue if you do not set those two values (char-width, max-char-width) in your code? i.e. not a bug with GtkLabel

----
Matthias Clasen [gtk+ developer] 2013-11-22 14:26:53 UTC

There's no point in waiting for it. GtkLabel behaves as it should here,
although it may be a little surprising at first.

You need to set suitable values for char-width and max-char-width.
----
Comment 10 dennis123321 2014-05-18 20:59:45 UTC
If you add "--no-wrap", the dialogs are correctly sized. Not sure if that means it is actually a Zenity problem...
Comment 11 dennis123321 2014-05-18 21:11:34 UTC
Sorry for this being the third reply in a short period of time... but it has been patched in Debian, so yes, it's a Zenity problem. The question is, why hasn't the patch been added upstream? (it has been over a year)

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702295
Comment 12 Arx Cruz 2014-05-18 23:24:26 UTC
I will test whether the patch works, if so, it will be in next release
Comment 13 Arx Cruz 2014-05-19 21:22:27 UTC
Created attachment 276803 [details]
zenity_big_window.png
Comment 14 Arx Cruz 2014-05-19 21:22:53 UTC
Created attachment 276804 [details]
zenity_ellipsize_start.png
Comment 15 Arx Cruz 2014-05-19 21:23:20 UTC
Created attachment 276805 [details]
zenity_ellipsize_none.png
Comment 16 Arx Cruz 2014-05-19 21:23:39 UTC
Created attachment 276806 [details]
zenity_label.png
Comment 17 Arx Cruz 2014-05-19 21:24:22 UTC
See images attached (all using zenity --warning --text='A b c d e f g h i j k l m n o p q r s t u v w x y z'):

zenity_big_window.png is how it is showed today

Then, notice that the height exactly the amount necessary to show all words when you shrink the window (zenity_label.png).

Using ellipsize option, the GtkLabel doesn't allocate a higher height (zenity_ellipsize_none.png) because if you resize the window, he will replace the beginning of the text in the GtkLabel for ... (zenity_ellipsize_start.png)

What can be done is add a new --ellipsize option to create this behavior.
Comment 18 Arx Cruz 2014-05-29 20:55:49 UTC
Okay, patch https://git.gnome.org/browse/zenity/commit/?id=e5eb127e9779b9a58e53b1a7d268b81284ebd241 fix this gracefully :)