GtkScrolledWindow container sends its child a size allocation with a negative coordinate

180 views Asked by At

I'm porting a custom Gtk+ widget from Gtk2 to Gtk3, and I'm observing that with the latter, I'm getting size_allocation calls from the parent widget (a GtkScrolledWindow) which have an allocation with a negative Y coordinate.

This causes my widget to freak out and do stupid things obviously. If I ignore the calls that contain negative coordinates, everything seems to work fine.

So the questions are:

  • Is this a gtk bug?
  • If not, in which circumstances should a parent send negative coordinates?
  • Why does this happen in GTK3 but not GTK2?

It happens with both gtk+ 3.6.4 (the one that comes in Ubuntu 13.04) and 3.8 (Ubuntu 13.10). Will test a higher version soon.

1

There are 1 answers

0
knocte On BEST ANSWER

It turns out that the problem was about how the widget was modifying its GtkAdjustment values, required to implement the Scrollable GInterface.

It seems to come from the fact that Gtk3 appears to be much more "liberal" in accepting weird values. Read the whole story in the commit message of the bugfix (open source, yeah!).