Re: gtk_widget_draw()

On Mon, Aug 9, 2010 at 6:46 PM, Havoc Pennington <hp pobox com> wrote:
> How would we handle widgets that currently have multiple windows and
> draw different things to each one (i.e. the expose handler is looking
> at the window in the expose event).
> For example GtkTextView
I'm not entirely sure yet. I want to guarantee two semantics:
1) The stuff looks correct on screen.
This one is a no-brainer. It should also be fast.
2) Calling gtk_widget_draw() draws all child widgets, even if they
have custom windows.
This is necessary, because nobody will like just getting a grey box
when the contained widgets all have custom windows. And I don't like
the whole just-paint-all-windows-one-after-another code in
gtk_widget_snapshot() at all.

My current idea on how to implement it is to give the widgets a hint
as to wether they are repainting a window or wether they are painting
to something else. Something like gdk_cairo_get_current_window() which
would return the currently invalidating GdkWindow or NULL. That would
basically replace event->window and then all you need to do is check
that the order of the draw calls is the window's stacking order and
you're all set.

Though I guess the exact implementation would depend on our changes to
GDK and the way we treat csw in GTK 3.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]