[comp.windows.x] asyncronous event notification

evt@dlcdev.UUCP (Eric Van Tassell) (11/23/88)

Well I'm still trying although I answered my previous posting. Still the
general question remains: "What is a body to do if polling with XNextEvent
is too slow"? tia


			dlcdev!eric@eddie.mit.edu

jim@athsys.uucp (Jim Becker) (11/24/88)

From article <111@dlcdev.UUCP>, by evt@dlcdev.UUCP (Eric Van Tassell):
> Well I'm still trying although I answered my previous posting. Still the
> general question remains: "What is a body to do if polling with XNextEvent
> is too slow"? tia
> 
> 
> 			dlcdev!eric@eddie.mit.edu


	I'm not sure if this fits your need, but a dirty little way to
see if there are events pending is by looking at the display
structure. The "head" element points to the first pending XEvent
structure (in a _XSQEvent structure); the "qlen" element is a count of
the number of pending XEvents in the input event queue. Note that there
may be further events that the process will get that haven't come back
because of buffering on in/output of the events.

	Before the MIT people flame me, let me say that I don't normally
go into this detail of looking at the X "internal" structures - and it
probabily isn't a good long term idea. It is one method to figure out
if there are events that have gotten to you that can be directly gotten
and processed w/o waiting though.

	Hope this helps!

-Jim Becker