GNOME Bugzilla – Bug 677609
GtkSizeGroup regression in GTK+ 3.3.20
Last modified: 2012-11-08 07:46:11 UTC
Created attachment 215825 [details] Broken layout I just tried to add a new email account via Edit -> Preferences -> Mail Accounts -> Add and the wizard has broken a layout (see attached screenshot). The console is full of warnings: evolution:25829): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -11 and height 26 This problem does not occur when editing an existing email account, the runtime warning appear though.
Looks like it might be theme-related. GTK+ 3.4 changed the rules for CSS somehow and a lot of themes haven't adapted yet. I have a theme I like called Clearwaita which is still broken, but Adwaita works fine. Try it with Adwaita?
The theme on the screenshot is Adwaita (just run from KDE). I tried it in Gnome 3.4.2 and the issue is present there, too. Using adwaita-gtk3-theme-3.4.2-1.fc17, gnome-desktop-3.4.2-1.fc17
What version of gtk3?
gtk3-3.4.3-2.fc17
*** Bug 677883 has been marked as a duplicate of this bug. ***
I wasn't seeing this issue with GTK+ 3.2. Switched to GTK+ 3.4 and it's there for me too now. So not theme-related after all, but yet another GTK+ 3.4 regression. Great. Gonna have to bisect the GTK+ 3.2 -> 3.4 releases to find what broke this. Those labels are all added to a GtkSizeGroup to keep them the same width, so the regression is likely in GtkSizeGroup. Reassigning to GTK+.
git bisect reveals the guilty commit to be: http://git.gnome.org/browse/gtk+/commit/?id=5d579811843f81db9866ac81afc5297f776cfb3b This commit causes the smooshed labels shown in attachment 215825 [details]. The relevant widget packing code in Evolution is here: http://git.gnome.org/browse/evolution/tree/mail/e-mail-config-identity-page.c#n219 I'm not doing anything out-of-line as far as I can tell. Just using a GtkSizeGroup to keep a bunch of labels the same width, with "ignore-hidden" set to TRUE since some labels may be hidden.
*** Bug 681465 has been marked as a duplicate of this bug. ***
*** Bug 687028 has been marked as a duplicate of this bug. ***
I think not setting gtk_size_group_set_ignore_hidden() in http://git.gnome.org/browse/evolution/tree/mail/e-mail-config-identity-page.c#n267 should get rid of the bug. If you have an evolution checkout handy, I'd be happy to have that confirmed.
Here's the longer explanation: GtkSizeGroup::ignore-hidden is broken. The usual steps taken when showing a window are: (1) request the sizes (2) allocate the sizes (3) show the window in the allocated size Showing the window with a random size between steps (1) and (2) would of course result in extra work and potential flickering when the widgets get resized to their proper sizes. However, as GtkSizeGroup::ignore-hidden uses gtk_widget_get_mapped() to determine visibility for a widget, the following will happen: (1) the widget will request a 0 size (2) the widget will be allocated a 0 size (3) the widget will be too small when it is shown There is 2 ways to fix this: (A) Don't use gtk_widget_get_mapped() but gtk_widget_get_visible() to determine if a widget should be shown. This will however change the semantics of the flag quite heavily. And it will require further changes as changing visibility of a widget currently does not queue a resize (and doing so could cause resize loops as size_allocate functions hide and show widgets depending on sizes.) (B) Ignore the GtkSizeGroup::ignore-hidden setting. This also changes semantics, but doesn't have lots of other caveats. I also think in most cases this is what people want. At least the volution code didn't look like it wanted that flag to be set at all. (C) Just keep the quickfix I pushed in git.gnome.org/browse/gtk+/commit/?id=73c64b4b67c526977831fbf748f5f284cbc894cb and pretend it's not a problem. I'm gonna do (C) in the 3.6 branch and (B) in master (with proper deprecations) unless someone convinces me otherwise.
(In reply to comment #10) > I think not setting gtk_size_group_set_ignore_hidden() in > http://git.gnome.org/browse/evolution/tree/mail/e-mail-config-identity-page.c#n267 > should get rid of the bug. If you have an evolution checkout handy, I'd be > happy to have that confirmed. Indeed that fixed it! Good enough for me. There seems to a theme-dependent component to this. I can't reproduce the issue on Adwaita or a unico-based theme I use called Clearlooks-Phenix, but I can with good ol' Raleigh. And most if not all of the complaints we've received on this have been from users on other desktops/distros. Just FYI.
Should be fixed in master now. I added that page as a testcase to our reftests.
(In reply to comment #13) > Should be fixed in master now. I added that page as a testcase to our reftests. Thanks for the fix [1]. commit 1ef057f983acf12a85caf014735a820d04cca6e4 Author: Benjamin Otte <otte@redhat.com> Date: Sun Nov 4 14:28:04 2012 +0100 reftests: Add a test from evolution This was used in a bug report. https://bugzilla.gnome.org/show_bug.cgi?id=677609 [1] http://git.gnome.org/browse/gtk+/commit/?id=1ef057f983acf12a85caf014735a820d04cca6e4
Is it possible to backport that to GTK+ 3.4.2, which will be released with Debian? Using Awesome WM and Gedit, trying to open the menus they are rendered all over the screen at different places. (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 383 and height -232 (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 373 and height -11 (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 373 and height -11 (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -1228867908 and height -493 (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 325 and height -493 (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:15008): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 325 and height -493 Same with Brasero, when going to copy CD/DVD the drop down items are not rendered properly. (brasero:5504): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 318 and height -390
I'm certainly not gonna attempt to backport it. But there was a reason why I didn't even attempt to put it into 3.6: I think the changes where a bit much (both semantically and code-amount wise).
(In reply to comment #16) > I'm certainly not gonna attempt to backport it. But there was a reason why I > didn't even attempt to put it into 3.6: I think the changes where a bit much > (both semantically and code-amount wise). I see. Could you point out the corresponding commits though please. The bug report number is only mentioned in the commit message of the test case(?) commit I pasted in comment #14. Benjamin, could you please also test, if Brasero’s copy dialog is displayed correctly with a GTK+ containing your fixes. Just start it and got to Copy CD/DVD. Are the drop down menus displayed correctly. They ware not on my system even when run Brasero in GNOME.
Created attachment 228323 [details] Brasero Screenshot Brasero's Copy dialog looks like this now.
(In reply to comment #18) > Created an attachment (id=228323) [details] > Brasero Screenshot > > Brasero's Copy dialog looks like this now. Thanks for the quick reply. Without any disc in the tray, you cannot see if the drop down menus work or not I guess. If you find a disc, it would be great if you could test those. Sorry for the trouble.
(In reply to comment #11) […] > (C) Just keep the quickfix I pushed in > git.gnome.org/browse/gtk+/commit/?id=73c64b4b67c526977831fbf748f5f284cbc894cb > and pretend it's not a problem. Applying that quickfix to 3.4.2 and rebuilding the packages I still see these error messages and the menus are are randomly placed on the screen with Gedit and GNOME Terminal. (gedit:22781): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:22781): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:22781): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 633 and height -35 (gedit:22781): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:22781): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion `height >= 0' failed (gedit:22781): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 633 and height -35 and Braseros combo box is also not fixed (bug 661394 [1]). (brasero:23018): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 385 and height -198 […] In Brasero `grep`ing for `gtk_size_group_set_ignore_hidden` did not give any results. [1] https://bugzilla.gnome.org/show_bug.cgi?id=661394
(In reply to comment #20) > (In reply to comment #11) > > […] > > > (C) Just keep the quickfix I pushed in > > git.gnome.org/browse/gtk+/commit/?id=73c64b4b67c526977831fbf748f5f284cbc894cb > > and pretend it's not a problem. > > Applying that quickfix to 3.4.2 and rebuilding the packages I still see these > error messages and the menus are are randomly placed on the screen with Gedit > and GNOME Terminal. > > (gedit:22781): Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: > assertion `height >= 0' failed […] I am deeply sorry. It looks like logging out and back in was not sufficient to get the rebuilt libraries take over. After a restart of the system the problem is fixed. Awesome! Thanks Benjamin!
(In reply to comment #19) > (In reply to comment #18) > > Created an attachment (id=228323) [details] [details] > > Brasero Screenshot > > > > Brasero's Copy dialog looks like this now. > > Thanks for the quick reply. Without any disc in the tray, you cannot see if the > drop down menus work or not I guess. If you find a disc, it would be great if > you could test those. Sorry for the trouble. Benjamin and all you GTK developers, I am sorry to bother you again and to have mixed up other problems in this report. Could you please take a quick look at bug 661394 [1], which shows strange combo box problems? Thanks! [1] https://bugzilla.gnome.org/show_bug.cgi?id=661394