* erik quanstrom ([EMAIL PROTECTED]) wrote:
> if this is a timing issue, then that should be addressed.  if your diagnosis 
> is
> correct, then if pagecache would slept until the event loop were running,
> that would fix the timing problem.
> 
> maybe something like
> 
> int   eventdawn;              /* set after event loop is fired up */
> 
> Image*
> cachedpage(Document *doc, int angle, int page)
> {
>       static int lastpage = -1;
>       static int rabusy;
>       Image *im;
>       int ra;
> 
> +     while(eventdawn == 0)
> +             sleep(1);

I'm afraid in this instance this wouldn't help. The control flow is smething
like main -> viewer -> { showpage -> cachedpage ; event loop }. Maybe
the following would better:

void
viewer(Document *dd)
{
        .
        .
        .

        midmenu.item = miditems;
        midmenu.gen = 0;
        midmenu.lasthit = Next;

<       showpage(page, &menu);
---
>       if(doc->npage > 0)
>               showpage(page, &menu);
        esetcursor(nil);

        Martin

Reply via email to