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 762754 - New GtkGrid/GtkCssGadget warnings have no obvious fix
New GtkGrid/GtkCssGadget warnings have no obvious fix
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-02-26 21:13 UTC by Kai Willadsen
Modified: 2016-03-07 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kai Willadsen 2016-02-26 21:13:06 UTC
Commit dde33623 fixed a previous problem where Meld's GtkGrid subclass wouldn't render at all, but now we get constant debug spew complaining about missing allocations. The allocations of every child in the GtkGrid are *identical* between both our subclass and a normal GtkGrid itself; removing the size_allocate override gets rid of the warnings.

I've tried everything I can think of to get this to work. I would be at the point of reimplementing GtkGrid's calls to GtkCssGadget APIs, but GtkCssGadget isn't exposed via introspection.

Since the GtkCssGadget changes seem to have changed the required behaviour for subclasses, can these APIs be exposed, preferably with some docs on what we need to do here?
Comment 1 Matthias Clasen 2016-02-27 01:47:23 UTC
I think the simple rule in the short term is: if you override size_allocate, you need to override draw as well. The reason for that is that the GtkGrid draw function is using its gadgets to draw, and gadgets require a size allocation in order to be drawn, which they will not get if you override size_allocate (and don't chain up).
Comment 2 Matthias Clasen 2016-02-28 02:53:10 UTC
The better advice is to chain up in both your size-allocate and your draw handler.
Comment 3 Matthias Clasen 2016-02-29 23:51:29 UTC
I have updated https://wiki.gnome.org/HowDoI/CustomWidgets to mention chaining up in size_allocate, and I've added a release note in https://git.gnome.org/browse/gtk+/tree/README.in#n87
Comment 4 Kai Willadsen 2016-03-05 21:10:41 UTC
Sorry for being slow to respond. Thanks for the documentation fixes, that's all good.

On a more general level, are there plans to expose the hooks called by GtkCssGadget as vfuncs? and will GtkCssGadget become public API? While I'm happy to have a fix (and yes, chaining up before doing our customer allocation fixes this just fine) it just feels weird that the widget will be doing size allocation calculations twice.
Comment 5 Matthias Clasen 2016-03-07 13:33:28 UTC
(In reply to Kai Willadsen from comment #4)
> Sorry for being slow to respond. Thanks for the documentation fixes, that's
> all good.
> 
>  will GtkCssGadget become public API?

Unknown