Path: utzoo!attcan!uunet!husc6!bloom-beacon!EXPO.LCS.MIT.EDU!rws From: rws@EXPO.LCS.MIT.EDU (Bob Scheifler) Newsgroups: comp.windows.x Subject: Re: button press/release race condition, lost events Message-ID: <8811192056.AA20497@EXPO.LCS.MIT.EDU> Date: 19 Nov 88 20:56:36 GMT References: <277@stan.com> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 32 Client Server ----------------------------- --------------------------- Select input on ButtonPress User presses button Dispatch press to user Receive button press Grab pointer selecting input on ButtonRelease & other stuff (e.g. ButtonMotion) Process Grab User releases button Dispatch release to user. User presses button again. *** Discarded, pointer still grabbed and ButtonPress not selected. Receive button release. Ungrab pointer Process Ungrab User releases button Dispatch release to user. Receive 2nd release, but no matching press. The grab is not necessary, but illustrates a common paradigm. The grab is necessary to get the kind of error you describe. Otherwise, the button press would have caused a grab, the event mask would not have changed, and the grab would have been release automatically when the button was released. Alternatively, your bug is that you aren't using synchronous event processing during the grab; if you had, then you would have been in a position to release the grab before the subsequent button press was processed.