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 662255 - GtkGrid row/column spacing causes negative sizes with no children (crashes Glade)
GtkGrid row/column spacing causes negative sizes with no children (crashes Gl...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
: 662845 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-10-19 23:06 UTC by Dariusz C
Modified: 2011-10-27 13:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stdout+backtrace (20.18 KB, text/x-log)
2011-10-19 23:06 UTC, Dariusz C
Details

Description Dariusz C 2011-10-19 23:06:48 UTC
Created attachment 199492 [details]
stdout+backtrace

To reproduce this bug:
  1. new Window
  2. place Tree View in it (model isn't needed, click create)
  3. select newly created treeview in inspector
  4. click icon 'Edit...' (last in glade toolbar)
  5. crash...

last line from standard output (much more in attachment):
Gtk-ERROR **: GtkBox child GladeEditorTable minimum height: -4 < 0
Trace/breakpoint trap

Attachment hold messages from output of not stripped binary + backtrace.

Ubuntu 11.10 amd64
Glade 3.10.0 (from repo)
Comment 1 Tristan Van Berkom 2011-10-19 23:30:26 UTC
Ah, yes... thanks for raising this.

I have it with GTK+ 3.2 but not with GTK+ 3.0

I'm almost certain that this is a bug in GtkGrid which
occurs when the grid has no children and has some spacing
specified.

It only showed up in Glade with recent versions of GTK+
because of a small api break which inverted the meaning
of the row spacing and column spacing.
Comment 2 Dariusz C 2011-10-20 09:04:02 UTC
In any measure I'm not an expert, but I think You can be right.

I commented line 66:
   gtk_grid_set_row_spacing (GTK_GRID (self), 4);
in function
   static void
   glade_editor_table_init (GladeEditorTable * self)
in file
   gladeui/glade-editor-table.c
git describe: GLADE_3_10_2-2-gda472e7

and no more crashing, thanks.
Comment 3 Tristan Van Berkom 2011-10-25 17:15:29 UTC
I dont have time to fix this today and havent found time to fix it
the past few days... so since I didn't fix it yet, better make sure
its reported in the right bugzilla and not keep it a secret anymore...

The fix is going to be very easy, the problem is obvious,
the GtkGrid reports negative requests when row/column spacing
is set to a positive value and there are no children.
Comment 4 Matthias Clasen 2011-10-26 23:49:53 UTC
Should be fixed by 
http://git.gnome.org/browse/gtk+/commit/?id=bb1d9aba86af715e5a5c53d5ad3b7dfcb720634e 
maybe ?
Comment 5 Tristan Van Berkom 2011-10-27 04:21:47 UTC
Yes great thanks.

Did a quick check: Updated, no crash... un-applied your patch just to
double-check (and the crash indeed comes back without your patch).
Comment 6 Tristan Van Berkom 2011-10-27 13:06:53 UTC
*** Bug 662845 has been marked as a duplicate of this bug. ***