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 703062 - GtkTreeViewColumn returns negative size request on empty treeview
GtkTreeViewColumn returns negative size request on empty treeview
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-06-25 15:30 UTC by Sebastien Bacher
Modified: 2013-09-30 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkTreeViewColumn: start padding at 0 (1.27 KB, patch)
2013-09-26 17:38 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Sebastien Bacher 2013-06-25 15:30:32 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.

  • #0 g_logv
    at /build/buildd/glib2.0-2.37.1/./glib/gmessages.c line 989
  • #1 g_log
    at /build/buildd/glib2.0-2.37.1/./glib/gmessages.c line 1025
  • #2 gtk_box_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkbox.c line 486
  • #3 g_cclosure_marshal_VOID__BOXEDv
    at /build/buildd/glib2.0-2.37.1/./gobject/gmarshal.c line 1160
  • #4 g_type_class_meta_marshalv
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 997
  • #5 _g_closure_invoke_va
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 840
  • #6 g_signal_emit_valist
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3234
  • #7 g_signal_emit
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3382
  • #8 gtk_widget_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkwidget.c line 5341
  • #9 gtk_box_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkbox.c line 661
  • #10 g_cclosure_marshal_VOID__BOXEDv
    at /build/buildd/glib2.0-2.37.1/./gobject/gmarshal.c line 1160
  • #11 g_type_class_meta_marshalv
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 997
  • #12 _g_closure_invoke_va
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 840
  • #13 g_signal_emit_valist
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3234
  • #14 g_signal_emit
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3382
  • #15 gtk_widget_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkwidget.c line 5341
  • #16 gtk_box_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkbox.c line 661
  • #17 g_cclosure_marshal_VOID__BOXEDv
    at /build/buildd/glib2.0-2.37.1/./gobject/gmarshal.c line 1160
  • #18 g_type_class_meta_marshalv
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 997
  • #19 _g_closure_invoke_va
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 840
  • #20 g_signal_emit_valist
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3234
  • #21 g_signal_emit
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3382
  • #22 gtk_widget_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkwidget.c line 5341
  • #23 gtk_box_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkbox.c line 661
  • #24 g_cclosure_marshal_VOID__BOXEDv
    at /build/buildd/glib2.0-2.37.1/./gobject/gmarshal.c line 1160
  • #25 g_type_class_meta_marshalv
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 997
  • #26 _g_closure_invoke_va
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 840
  • #27 g_signal_emit_valist
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3234
  • #28 g_signal_emit
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3382
  • #29 gtk_widget_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkwidget.c line 5341
  • #30 gtk_window_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkwindow.c line 5597
  • #31 g_cclosure_marshal_VOID__BOXEDv
    at /build/buildd/glib2.0-2.37.1/./gobject/gmarshal.c line 1160
  • #32 g_type_class_meta_marshalv
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 997
  • #33 _g_closure_invoke_va
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 840
  • #34 g_signal_emit_valist
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3234
  • #35 g_signal_emit
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3382
  • #36 gtk_widget_size_allocate
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkwidget.c line 5341
  • #37 gtk_window_show
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkwindow.c line 4816
  • #38 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.37.1/./gobject/gmarshal.c line 85
  • #39 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 970
  • #40 g_closure_invoke
    at /build/buildd/glib2.0-2.37.1/./gobject/gclosure.c line 777
  • #41 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3512
  • #42 g_signal_emit_valist
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3326
  • #43 g_signal_emit
    at /build/buildd/glib2.0-2.37.1/./gobject/gsignal.c line 3382
  • #44 gtk_widget_show
    at /build/buildd/gtk+3.0-3.8.2/./gtk/gtkwidget.c line 4161
  • #45 gsm_properties_dialog_constructor
    at gsm-properties-dialog.c line 662
  • #46 g_object_new_with_custom_constructor
    at /build/buildd/glib2.0-2.37.1/./gobject/gobject.c line 1657
  • #47 g_object_new_internal
    at /build/buildd/glib2.0-2.37.1/./gobject/gobject.c line 1736
  • #48 g_object_newv
    at /build/buildd/glib2.0-2.37.1/./gobject/gobject.c line 1882
  • #49 g_object_new
    at /build/buildd/glib2.0-2.37.1/./gobject/gobject.c line 1548
  • #50 gsm_properties_dialog_new
    at gsm-properties-dialog.c line 770

Comment 1 Allison Karlitskaya (desrt) 2013-09-26 16:53:00 UTC
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.
Comment 2 Allison Karlitskaya (desrt) 2013-09-26 17:36:34 UTC
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.
Comment 3 Allison Karlitskaya (desrt) 2013-09-26 17:38:29 UTC
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.
Comment 4 Allison Karlitskaya (desrt) 2013-09-26 17:39:10 UTC
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.
Comment 5 Allison Karlitskaya (desrt) 2013-09-30 13:23:37 UTC
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
Comment 6 Allison Karlitskaya (desrt) 2013-09-30 13:23:54 UTC
Attachment 255860 [details] pushed as e3b9ea5 - GtkTreeViewColumn: start padding at 0

and will merge to stable