Avoiding flickering



Hi,

In one of my previous messages, I have mentioned that trying to avoid
flickering using general approach may lead to other disatvantages. Now I
am going to discuss this topic further. If gdk drawing is done using
double buffering, i.e. back pixmaps, the applications will be redrawen
fine, but the memory usage to achieving this is unfoundedly large.

One of the most disappointing "features" in gdk is the flickering on the
main window resize. The reason for that flickering is very simple - the
main window is redrawen before all of the other widgets. Do we need
double buffering to avoid that kind of flickering? Definitely NO! The
problem is in gdk - it is very "kind" and on every window creation sets
the background_pixel to some value. In this case, on every window redraw
(resize generates a redraw), X window server fills the window area with
the background_pixel color! So, if the background pixel is undefined the
X server WILL not perform any fill of the window area. In case, your
main window client area is entirely occupied by another widget (the most
common case), it will be redrawed without any flickering, because the
only performed drawing is done in your "gtk_widget_draw" handler!

So, my proposal is leave the background_pixel and eventually
background_pixmap members undefined by default.
	Ivan


-- 
Sent through Global Message Exchange - http://www.gmx.net



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