Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!think!bloom-beacon!CITI.UMICH.EDU!spencer From: spencer@CITI.UMICH.EDU Newsgroups: comp.windows.x Subject: Re: HELP! (sockets/X) Message-ID: <8808221425.AA15060@EXPO.LCS.MIT.EDU> Date: 22 Aug 88 14:24:00 GMT References: <20088@citi.umich.edu> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 21 In article <20088@citi.umich.edu> convex!authorplaceholder@texsun.central.sun.com writes: > It also needs to look for events from the > X server (exposes, mouse clicks, etc.). I really don't want to do a > non blocking select, check if there are X events and then go back to > sleep. You can do this easily by getting the file descriptor of the display connection, and adding that to your select() call. E.g.: Display * dpy; int readfs, xfd; ... xfd = ConnectionNumber(dpy); readfds |= 1 << xfd; ... select( ..., &readfds, ... ); ... if ( readfds & (1 << xfd) ) ProcessXEvents(dpy); =Spencer (spencer@crim.eecs.umich.edu)