I finally forced to use maximally 25 fps, by using a lock flag.
bool lock = 0;bool needs_redraw = 0;void Redraw(){ if(lock){ needs_redraw = 1; return; } //draw image to a surface needs_redraw = 0; lock = 1; Glib::signal_timeout().connect(Unlock, 20); queue_draw();}bool Unlock(){ lock = 0; if(needs_redraw) Redraw(); return false;}void on_expose_event(something){ //copy image from surface to widget's context}
This is a sample code, but that's the idea. It will disallow redraw to be done more often then once per 20 ms.