Date: Mon, 16 Aug 2004 09:46:40 +0800 From: "wilson loi" Subject: Re: [nanogui] Patch for NONNETWORK NxLib Hi, I think the most reason that I change the GrPeekEvent GsSelect is because of the 'XEventsQueued' this NxLIB code would block the system if it does not "Peek" any event ----------------------------------- int XEventQueue(...) { ... if (!ret && mode != QueueAlready) { if (mode = QueueAfterFlush) GrFlush(); if (GrPeekEvent(&temp)) <----------------------------------- { ret = 1; } } } } ------------------------------------ On the other hand, I am curious that Microwindows will release the next version. Since the last release is 2003/6 Thanks a lot ! Wilson. ----- Original Message ----- From: "Greg Haerr" To: "wilson loi" ; Sent: Friday, August 13, 2004 11:00 PM Subject: Re: [nanogui] Patch for NONNETWORK NxLib > : Here is a patch for NxLib running on NONNETWORK. However, I don't know if > it > : is correct or not. Can someone give me some comment ??? > > Yes - it looks pretty good, thanks! > > > : I found that the GrPeekEvent will block if there is no event on the list. > So > : I change the GsSelect(-1) to GsSelect(0); > : It is valid or not ? > : > : > : @@ -169,7 +169,8 @@ > : #if NONETWORK > : /* if no events on queue, force select() event check*/ > : if (elp == NULL) { > : - GsSelect(-1L); /* poll*/ > : + GsSelect(0); /* poll */ > > The original code above is required for the normal NONETWORK > case. (Also, the 'poll' comment should be 'wait'). We've got > to figure a way to change this to polling only when NXLIB > is linked. This is because the X server operates just a little > differently with regards to exactly how a client waits on > an X event, which forces nano-X to poll here, as you've coded it. > (NXLIB issues a seperate select() so it's not always polling) > > Regards, > > Greg > > --------------------------------------------------------------------- To unsubscribe, e-mail: nanogui-unsubscribe@linuxhacker.org For additional commands, e-mail: nanogui-help@linuxhacker.org