Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!bloom-beacon!mit-vax!josh From: josh@mit-vax.LCS.MIT.EDU (Joshua Marantz) Newsgroups: comp.windows.x Subject: Re: Detecting/Compressing Multiple Exposure Events - how ? Message-ID: <4652@mit-vax.LCS.MIT.EDU> Date: 31 Aug 88 01:30:19 GMT References: <126@tityus.UUCP> Organization: MIT LCS, Cambridge, MA Lines: 34 In-reply-to: jim@athsys.uucp's message of 30 Aug 88 17:54:08 GMT This article brings up a good point. The existing Xlib procedures for manipulating the event queue need to be augmented. Another way to solve the redundant exposure problem would be to provide two Pending routines that do not block, and do not remove matched events from the queue. These would complement the functionality of XCheckIfEvent and XCheckMaskEvent. They might be called: XIfPending (display, event_return, predicate, arg); XMaskPending (display, event_return, event_mask, arg); Currently, I have to emulate that functionality with an XCheckIfEvent followed by an XPutBackEvent, which has the annoying side effect of rearranging the event queue. The only solution I can think of that does not require a change to Xlib is to create your own event queue and move all of X's events into it whenever there are X events pending. This permits you to define your own methods of access to the event queue. Another advantage of defining your own event queue is that you can efficiently filter out uninteresting events, check for user interrupts (like Control-C), and so on. This is more efficient than using the Xlib event manipulation functions (even with the addition of XIfPending and XMaskPending) because each event will be examined once by a filter that may flag it as either very interesting (such as an interrupt character), or very uninteresting (a redundant expose or pointer-motion event). If you leave the events in X's event queue, you must rescan the entire event queue each time you want to check for an interrupt. Note that the auxiliary event queue can utilize X's event structures, which simplifies the implementation and elliminates extraneous data copying. -Joshua Marnatz Viewlogic Systems, Inc.