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 765596 - Gtk-WARNING **: Negative content width -12 (allocation 1, extents 6x7) while allocating gadget (node button, owner GtkButton)
Gtk-WARNING **: Negative content width -12 (allocation 1, extents 6x7) while ...
Status: RESOLVED DUPLICATE of bug 770388
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
3.92.x
Other All
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2016-04-26 11:01 UTC by Christian Stadelmann
Modified: 2018-02-10 12:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A backtrace from gdb attached to evolution (75.41 KB, text/plain)
2016-04-26 20:13 UTC, Christian Stadelmann
Details

Description Christian Stadelmann 2016-04-26 11:01:19 UTC
Steps to reproduce:
1. start evolution from terminal. On fedora you might need to specify environment variable G_ENABLE_DIAGNOSTIC=1 first.
2. watch output on cli
3. open preferences dialog

What happens:
This warning appears 4 times:
Gtk-WARNING **: Negative content width -12 (allocation 1, extents 6x7) while allocating gadget (node button, owner GtkButton)

What should happen:
No warning

Affected versions:
gtk3-3.20.3-1.fc24.x86_64
glib2-2.48.0-1.fc24.x86_64
evolution-3.20.1-1.fc24.x86_64
Comment 1 Milan Crha 2016-04-26 17:44:51 UTC
Thanks for a bug report. I do not see any such warning here, I see many warnings about deprecated properties being used, but not this negative content. I think the "No warning" state is somehow odd, because evolution doesn't target only the latest gtk3, but also some older, which makes things slightly more complicated.

If you could install debuginfo packages for the gtk3 and the evolution [1], then run evolution under gdb like this:
   $ gdb evolution --ex r --ex "b g_logv" --ex c --ex bt
then, before you call Edit->Preferences, press Ctrl+C in the terminal with gdb once, thus the breakpoint is added, and after that call the Preferences, and use the sequence "c" "bt" whenever the gdb prompt is shown, thus you'll get all the backtraces for each warning, then it may show the place which cases it, particularly the button. Maybe.

[1] command to install them, being run as root, is:
    # dnf install evolution-debuginfo gtk3-debuginfo --enablerepo=*-debuginfo
    Only make sure that the installed packages will have exactly the same
    versions as their binary packages; otherwise update also the binary packages.
Comment 2 Christian Stadelmann 2016-04-26 20:13:43 UTC
Created attachment 326801 [details]
A backtrace from gdb attached to evolution

I slightly modified the command to make it more automatic (your command worked fine though):

$ LC_ALL=C gdb evolution --ex "set logging file ~/evolution-negative-content-width" --ex "set logging on" --ex r --ex "b g_logv" --ex c --ex "bt full" --ex detach --ex quit

Backtrace looks like this is in Gtk+ stack only, but I'm not sure about that.
Comment 3 Milan Crha 2016-04-27 10:21:37 UTC
Thanks for the update. If I read it properly, then it's about a GtkButton placed inside a GtkTreeView (probably a column header) which is placed inside an ECertManagerConfig, thus inside the Certificates tab. As this is claiming about an internal GtkTreeView button, then I'm unsure whether it's evolution's fault at all. It can be, if it sets such negative width to some column in the tree view.

Could you check whether any negative value is stored in 
   ~/.config/evolution/cert_trees.ini
please?

Eventually move away that file and then start evolution and verify whether the warning will be still printed (when the default column widths will be used, instead of loading the previous settings from the file), please?
Comment 4 Christian Stadelmann 2016-06-07 16:45:41 UTC
No, there were no negative values in that file(In reply to Milan Crha from comment #3)
> Could you check whether any negative value is stored in 
>    ~/.config/evolution/cert_trees.ini
> please?

No, there were no negative values there.

> Eventually move away that file and then start evolution and verify whether
> the warning will be still printed (when the default column widths will be
> used, instead of loading the previous settings from the file), please?

I deleted the file and the warnings were gone.

Steps to reproduce to create negative column widths:
1. open preferences
2. open "Certificates" 
3. resize columns to be too small
Same warnings appear again.

After restarting evolution, they were gone. No negative values in cert_trees.ini either. Columns still have a width of 0 and are invisible.

How about setting a minimum column width?
How about auto-calculating a width for all columns? Users are not supposed to have to resize columns anyway, computers are way better for that task ;)
Comment 5 Milan Crha 2016-06-13 08:51:52 UTC
Ah, I see, it gets "negative" due to some CSS constraints (I guess due to set padding).

I tried to reproduce this in a gtk3-demo, which doesn't have any resizable columns, thus I modified one of the examples and enabled resizing for them with gtk_tree_view_column_set_resizable() and I can reproduce the runtime warning there too. It doesn't make sense to workaround the issue on the Evolution side only, also because different themes can have different minimal size for the button, thus I'm moving this to gtk+ instead, to have fixed the root of the issue.
Comment 6 Matthias Clasen 2018-02-10 05:22:09 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 7 Christian Stadelmann 2018-02-10 09:52:23 UTC
This issue is still present with gtk4 (3.92.1).

Steps to reproduce:
1. open gtk4-demo
2. open any of the GtkTreeView demos (under "TreeView")
3. open GtkInspector (Ctrl+Shift+I)
4. make any column resizable
5. resize column to be very narrow (width does not need to be 0)

What happens:
(gtk4-demo:8169): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -9 and height 24
Comment 8 Timm Bäder 2018-02-10 12:34:31 UTC
This is a duplicate of 770388, which contains some proof-of-concept patches at least. The problem is pretty obviously that GtkTreeView just passes the row width to the button without checking it against the button's minimum width.

*** This bug has been marked as a duplicate of bug 770388 ***