GNOME Bugzilla – Bug 673643
Zenity windows get TOO HIGH when text contains many words
Last modified: 2014-05-29 20:55:49 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'
Confirmed, I am having the same bug.
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?
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...
I will work on this issue (although patches are mostly welcome).
New observation: with --error, the bug is 2x more important than with --info , --warning.
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.
Seems like a reasonable way to solve this, even though it might break some existing scripts?
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 ***
(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. ----
If you add "--no-wrap", the dialogs are correctly sized. Not sure if that means it is actually a Zenity problem...
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
I will test whether the patch works, if so, it will be in next release
Created attachment 276803 [details] zenity_big_window.png
Created attachment 276804 [details] zenity_ellipsize_start.png
Created attachment 276805 [details] zenity_ellipsize_none.png
Created attachment 276806 [details] zenity_label.png
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.
Okay, patch https://git.gnome.org/browse/zenity/commit/?id=e5eb127e9779b9a58e53b1a7d268b81284ebd241 fix this gracefully :)