GNOME Bugzilla – Bug 703062
GtkTreeViewColumn returns negative size request on empty treeview
Last modified: 2013-09-30 13:23:57 UTC
That's new since GTK 3.8 (doesn't happen with 3.6) If you run gnome-session-properties (3.8 or trunk for example) and have no autostart desktop list, the capplet hits that error: "(gnome-session-properties:10935): Gtk-ERROR **: GtkBox child GtkScrolledWindow minimum width: -1 < 0 for height 321 Program received signal SIGTRAP, Trace/breakpoint trap.
+ Trace 232143
I suspect this is a bug in the Ubuntu themes because switching to the high-contrast theme makes the issue go away. Closing for now. Will reopen if I discover that the problem is really on Gtk's side.
Pretty sure this is actually a Gtk bug after all. The reason that we only see this bug on Ubuntu is because we don't have scrollbars there, and the scrollbar provides a workaround to the issue by adding some extra width to the allocation, making it non-negative.
Created attachment 255860 [details] [review] GtkTreeViewColumn: start padding at 0 If we start with a padding of -1 then it can leak out of the size allocation request for the column when the treeview is empty. The GtkTreeView will then collect these -1 values and add them together, returning -n where 'n' is the number of columns. This is usually not a problem because treeviews tend to be used with a scrollbar and the width of the scrollbar will be added to this number bringing it into positive territory again. On Ubuntu, with overlay scrollbars, this is not the case, however.
Not being too familiar with the treeview code, I'm not sure if this patch is correct. It seems pretty sane from my understanding of what's going on there, though.
09:20 <@alex> desrt: i can't say i know this code, but that does seem sane 09:20 <@alex> desrt: there is never any reason to have a -1 padding... 09:20 < desrt> alex: i agree! 09:20 < desrt> alex: in fact, there is a _set_dirty() function in there that puts it back to 0 09:20 <@alex> exactly 09:20 <@alex> and all changes are MAX() 09:21 <@mclasen> desrt: seems right to me
Attachment 255860 [details] pushed as e3b9ea5 - GtkTreeViewColumn: start padding at 0 and will merge to stable