Frage

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.

War es hilfreich?

Lösung

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!).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top