Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!usc!snorkelwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines From: mouse@larry.mcrcim.mcgill.EDU Newsgroups: comp.windows.x Subject: Re: Problem with XSync ? Message-ID: <9101212029.AA16284@Larry.McRCIM.McGill.EDU> Date: 21 Jan 91 20:29:15 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 32 > XSync ( dpy, False); > evt_waiting = XPending ( dpy ); > while ( evt_waiting ) > { > XtAppNextEvent ( App_ctxt, &evt ); > XtDispatchEvent ( &evt ); > XSync ( dpy, False ); > evt_waiting = XPending ( dpy ); > } > Normally, when I'm exiting the loop, all the requests sent to the > server, must have been treated by the server. True. When XSync() returns, you know that all requests made have been sent to the server and acted upon. > In fact, very often , that's not. Without more information about what makes you think this isn't true, I can't say very much more. All that comes to mind is that you're mixing Xt code with Xlib code, which has bug potential (perhaps Xt has a buffer of some sort that XSync doesn't know about and can't flush?). > And if I wait a while, new events come from the server. Well, of course. Events can be generated asynchronously by user actions (or other programs' actions). der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu