Re: Some questions on double buffering and expose in gtk2.

Martin Sevior <msevior physics unimelb edu au> writes:
> 	     My solution was to put the redraw into a gtk_idle function so the
> redraw happens after gtk finishes doing whatever it is doing. 

I really doubt that's the right fix. expose_event is _already_ called
out of an idle, unless gdk_window_process_updates() has been called

One case where this happens is if you are sharing a GdkWindow with a
scrollbar (scrollbar is a NO_WINDOW widget, maybe your widget is
too). That could process_updates() on your widget as a side effect.

But widgets that scroll should be calling process_updates() themselves
anyway when the scroll adjustment changes, or the scrolling will look
funny. See GtkTextView for an extremely nontrivial and complicated

Anyway, if your code works in an idle and doesn't work in
expose_event, I would say there's still a bug in there, you're just
hiding it.
> Maybe the issue has something to do with drawing with xft enabled
> FreeType.

Maybe, but that should not make a difference.


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