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 677609 - GtkSizeGroup regression in GTK+ 3.3.20
GtkSizeGroup regression in GTK+ 3.3.20
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.4.x
Other Linux
: Low normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 677883 681465 687028 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-06-07 08:01 UTC by Dan Vrátil
Modified: 2012-11-08 07:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Broken layout (38.49 KB, image/png)
2012-06-07 08:01 UTC, Dan Vrátil
Details
Brasero Screenshot (15.44 KB, image/png)
2012-11-06 23:41 UTC, Benjamin Otte (Company)
Details

Description Dan Vrátil 2012-06-07 08:01:38 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.
Comment 1 Matthew Barnes 2012-06-07 11:48:39 UTC
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?
Comment 2 Dan Vrátil 2012-06-08 10:47:06 UTC
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
Comment 3 Matthew Barnes 2012-06-08 11:05:02 UTC
What version of gtk3?
Comment 4 Dan Vrátil 2012-06-08 11:35:41 UTC
gtk3-3.4.3-2.fc17
Comment 5 Matthew Barnes 2012-06-11 18:04:18 UTC
*** Bug 677883 has been marked as a duplicate of this bug. ***
Comment 6 Matthew Barnes 2012-06-22 19:50:52 UTC
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+.
Comment 7 Matthew Barnes 2012-07-01 03:09:26 UTC
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.
Comment 8 Dan Vrátil 2012-08-08 17:06:43 UTC
*** Bug 681465 has been marked as a duplicate of this bug. ***
Comment 9 Matthew Barnes 2012-10-28 11:33:07 UTC
*** Bug 687028 has been marked as a duplicate of this bug. ***
Comment 10 Benjamin Otte (Company) 2012-11-01 19:39:20 UTC
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.
Comment 11 Benjamin Otte (Company) 2012-11-01 19:55:19 UTC
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.
Comment 12 Matthew Barnes 2012-11-01 20:26:39 UTC
(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.
Comment 13 Benjamin Otte (Company) 2012-11-04 14:35:53 UTC
Should be fixed in master now. I added that page as a testcase to our reftests.
Comment 14 Paul Menzel 2012-11-06 23:09:10 UTC
(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
Comment 15 Paul Menzel 2012-11-06 23:14:41 UTC
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
Comment 16 Benjamin Otte (Company) 2012-11-06 23:20:11 UTC
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).
Comment 17 Paul Menzel 2012-11-06 23:34:49 UTC
(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.
Comment 18 Benjamin Otte (Company) 2012-11-06 23:41:27 UTC
Created attachment 228323 [details]
Brasero Screenshot

Brasero's Copy dialog looks like this now.
Comment 19 Paul Menzel 2012-11-06 23:53:27 UTC
(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.
Comment 20 Paul Menzel 2012-11-07 16:20:00 UTC
(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
Comment 21 Paul Menzel 2012-11-08 07:43:27 UTC
(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!
Comment 22 Paul Menzel 2012-11-08 07:46:11 UTC
(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