Hi,
I've collected a whole bunch of changes in th wip/baedert/drawing branch.
Here's a little overview of how things work in there, so we can decide
if it's the right way forward.
- gtk_widget_real_snapshot calls gtk_widget_snapshot_child on all the
child widgets of the given GtkWidget instance. This makes sense to me
but it's already been problematic when porting GtkScale and GtkRange
away from gadgets because GtkRange didn't override ::snapshot so
GtkScale couldn't just subclass it and chain up, since it would cause
all child widgets to be drawn twice.
Remaining problems/open questions:
- Both GtkWindow and GtkPopover are special-cased in
gtk_widget_snapshot to not draw the CSS background and border for
them, since they are just too special. Getting rid of that special
case would require porting them away from manual background drawing.
- There are lots of CSS problems now of course, e.g. GtkRevealer does
not hide its padding anymore so GtkSearchBar always leaves a few
pixels of space around, or the 4px margin around GtkMenu which is not
applied inside the toplevel instead of outside. Also GtkCheckButton
obviously.
- Focus outlines work out pretty badly the way they are currently done
in the branch. Wit gadgets, widgets had pretty fine-grained control
over which gadget draws the focus outline.