re: on_expose_event not being called when expected (Garth's KidStuff)



From: "Garth's KidStuff" on 06/11/2008 :

This logic works impeccably (*grin*) until the CPU is under heavy load. In
that case, I can see the invalidate_rect calls happening but
on_expose_event doesn't get called until the cpu load is back to normal.
I've been banging my head against this for a few days now and would
love some new ideas about how to attack the problem.
I found a function -- gdk_window_process_all_updates() -- that seems to
solve this problem. If I call this immediately after invalidating the rectangles,
then on_expose_event always gets called even under the adverse
conditions described above.

Out of interest, have you tried playing with event priorities at all...?
Shift the periodic timer to a very low priority (lower than GTK+'s book keeping and I/O handlers).


If that doesn't work, set up a see-saw between it and the expose handler, something like this; increment an 
integer flag from the timer.  Only if the flag is now 1, perform the action and allow the timer to persist.  
From the expose handler, invoke the timer action and set the timer if the flag is 2, and in any case reset it 
now to zero.  Under good conditions the timer will always see a zero and raise it to a one, and the expose 
will always see a one and drop it back to zero.  If things mess up, the timer will raise it to two and stop 
re-triggering until the expose handler runs, which will see the two, perform the timer action (which should 
likely be in a common function), restart the timer, and again, reset the counter back to zero.


Someone else may have a better idea, but hopefully that helps.

Fredderic


------------------------------------------------------------
Domain Registration
Cheap Domain Registration - Click now.
http://tagline.excite.com/fc/JkJQPTgLMJA6FHZ1HYp57nkgeZWMJKPTqcYYTVrv3iUzLDQcbgMYUz/


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