Path: utzoo!attcan!uunet!wuarchive!rex!uflorida!gatech!bloom-beacon!dont-send-mail-to-path-lines From: andy@lgc.COM Newsgroups: comp.windows.x Subject: Re: Possible Event Handler Bug Message-ID: <9101122029.AA08824@kiwi.lgc.com> Date: 12 Jan 91 20:29:27 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 20 uunet!sting.berkeley.edu!scott (Scott Silvey) writes: > Basically, on a ButtonPress event, I want to start tracking the mouse by > installing a PointerMotion event handler. Unfortionately, the PointerMotion > handler doesn't actually get registered ... annoying as hell. The problem here is the implicit pointer grab that the server starts when the pointer button goes down (see 8.4.1.1 of the Scheifler/Gettys/Newman book). That grab selects for those pointer events that you were already selected for when the button went down. Changes made with XSelectInput (via XtAddEventHandler) while the button is still down don't take effect until the button is released, which is not what you want. I think if you call XChangeActivePointerGrab in your button press event handler with a mask that includes PointerMotionMask and ButtonReleaseMask, your problem will go away (but I haven't actually run the test). Andy Dysart (andy@lgc.com) Landmark Graphics Corp. Tel: (713) 579-4762 Houston, TX 77094 Fax: (713) 579-4814