GNOME Bugzilla – Bug 780268
Zenity message dialogs doesn't wrap text and grow in height with message length
Last modified: 2017-04-04 13:52:01 UTC
Created attachment 348262 [details] [review] Fix message dialog width and height on recent Gtk The fix for "Bug 670496 - Zenity info/error windows grow in height with message length" (https://bugzilla.gnome.org/show_bug.cgi?id=670496) doesn't work with Gtk 3.22 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. 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. The bug in GTK seems to be https://bugzilla.gnome.org/show_bug.cgi?id=657621. Unfortunately the documented workaround apparently stopped working. The attached patche fixes most of the issue. However, with message length less than 60 characters, it makes the dialog wider than it could be. The following python code could be used to fix that (I don't have the skills to translate this into C): longest_line = max([len(l) for l in text.splitlines()]) label.set_width_chars(min(longest_line, 60))
Fixed! Thanks! https://git.gnome.org/browse/zenity/commit/?id=db4a0c3c0f8b224870ea23a3b3c25f800ee4870a
(In reply to Arx Cruz from comment #1) > Fixed! Thanks! > https://git.gnome.org/browse/zenity/commit/ > ?id=db4a0c3c0f8b224870ea23a3b3c25f800ee4870a Ignore it, was a fix for another bug, sorry for the inconvenience.
I REALLY hope, this time we fix this problem for real! Fixed in https://git.gnome.org/browse/zenity/commit/?id=3b64d05e8a1aae1581d2bec7288d80ac4699e1b1 I changed the 'magic number' from 60 to 10 because it was changing the space between the icon and text when you resize the window. Also I change the glade file in order to icon not fill the all the space.