Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!rochester!pulse!sandeep From: sandeep@pulse.UUCP (Sandeep Mehta) Newsgroups: comp.windows.x Subject: Blocked and Non-Blocked Event Handling in X Message-ID: <231@pulse.UUCP> Date: Tue, 25-Aug-87 11:27:20 EDT Article-I.D.: pulse.231 Posted: Tue Aug 25 11:27:20 1987 Date-Received: Wed, 26-Aug-87 06:33:37 EDT Reply-To: sandeep@ur-laser.UUCP (Sandeep Mehta) Organization: Laboratory for Laser Energetics, U. of R., Rochester, NY Lines: 99 Once again I ran into some grey areas with X. The XNextEvent and XWindowEvent routines are blocking routines. Thus if the event queues are empty or dont have the event specified by the mask, they block waiting for an appropriate event . To escape that , there is a non-blocking XCheckWindowEvent routine, which does'nt seem to return if it doesn't find the masked event !! Here is the scenario: My event loop has to take care of two events. It reads from a pipe which is a blocking read too, so I do a ioctl(fd,FIONREAD,&count) before a read to see if there is any data buffered. Then I need to check to see if there are any ButtonEvents or ExposeWindow Events take appropriate action, and go back to reading the pipe for more data !! Thus XCheckWindowEvent seems to be a nice way out. However I cant seem to fall out of that event check. I poked into the XChkWinEvent.c file to see what was happening, and it seems to be stuck in the for ( prev = NULL, qelt = dpy->head; qelt && (qelt->event.window ...... loop. Therefore I assumed that it goes on until the end of list or till the event is found ... it did'nt !!!! Is there a problem with XFlushing the event queue, before calling this routine or with the mask ? I even tried different masks to make sure. Would appreciate any help in this regard, till then I am stuck with blocked XNextEvent() (:-() (:-() Thanks in advance sandeep *********************************************************************** Sandeep Mehta Lab for Laser Energetics Univ. of Rochester. Tel. (716)-427-2379 (H) (716)-275-5101 (W) ARPA: sandeep@pulse.lle.rochester.edu UUCP: {allegra,seismo}!rochester!pulse!sandeep BITNET: snm1237@ritvaxa.BITNET *********************************************************************** Disclaimer: Language is a Virus .... (Laurie Anderson) *********************************************************************** Newsgroups: comp.windows.x Subject: Blocked and Non-Blocked Event Handling in X Expires: References: Sender: Reply-To: sandeep@ur-laser.UUCP (Sandeep Mehta) Followup-To: Distribution: Organization: Laboratory for Laser Energetics, U. of R., Rochester, NY Keywords: Once again I ran into some grey areas with X. The XNextEvent and XWindowEvent routines are blocking routines. Thus if the event queues are empty or dont have the event specified by the mask, they block waiting for an appropriate event . To escape that , there is a non-blocking XCheckWindowEvent routine, which does'nt seem to return if it doesn't find the masked event !! Here is the scenario: My event loop has to take care of two events. It reads from a pipe which is a blocking read too, so I do a ioctl(fd,FIONREAD,&count) before a read to see if there is any data buffered. Then I need to check to see if there are any ButtonEvents or ExposeWindow Events take appropriate action, and go back to reading the pipe for more data !! Thus XCheckWindowEvent seems to be a nice way out. However I cant seem to fall out of that event check. I poked into the XChkWinEvent.c file to see what was happening, and it seems to be stuck in the for ( prev = NULL, qelt = dpy->head; qelt && (qelt->event.window ...... loop. Therefore I assumed that it goes on until the end of list or till the event is found ... it did'nt !!!! Is there a problem with XFlushing the event queue, before calling this routine or with the mask ? I even tried different masks to make sure. Would appreciate any help in this regard, till then I am stuck with blocked XNextEvent() (:-() (:-() Thanks in advance sandeep *********************************************************************** Sandeep Mehta Lab for Laser Energetics Univ. of Rochester. Tel. (716)-427-2379 (H) (716)-275-5101 (W) ARPA: sandeep@pulse.lle.rochester.edu UUCP: {allegra,seismo}!rochester!pulse!sandeep BITNET: snm1237@ritvaxa.BITNET *********************************************************************** Disclaimer: Language is a Virus .... (Laurie Anderson) ***********************************************************************