Re: [Fresco-devel] animation
Nick Lewycky <[email protected]>
| Newsgroups | gmane.comp.video.fresco.devel |
|---|---|
| Message-ID | <[email protected]> |
Nathaniel Smith wrote: >>===== Original Message From Nick Lewycky <[email protected]> ===== >>Stefan Seefeld wrote: >> >>>Nick Lewycky wrote: >>> [snip] >>>the 'event loop' the repair thread is sitting in is receiving input from >>>the input devices as well as a pipe the ScreenManager is connected to. >>>If you call 'need_redraw' on any graphic, it will result in the >>>ScreenManager to 'wake_up' the repair thread by means of that pipe. >>>That's about as event driven as you can get. >> >>You're right. A quick hack to delay the need_redraw request until after >>the traversal has completed fixes everything. Thank you. > > Hmm, how silly. Shouldn't redraw requests that occur during the traversal > queue up to be processed after the traversal finishes? Or if this is what > happens, then shouldn't the repair thread check that queue? We can poll whether there's damage at any time. The question is, should we poll before or after we block for events? If we poll before, a Graphic like mine would cause the system to never process events because it would never enter the event loop. Right now, we poll after. Would it help to add a hasEventsWaiting API to the Console so that we can check it? The logic would be redraw, check for waiting events and if there are none, move on to the check for current damage? And if there are events, calling next_event will NOT block? That sounds cleaner to me. Nick Lewycky