Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!vsi1!daver!athsys!jim From: jim@athsys.uucp (Jim Becker) Newsgroups: comp.windows.x Subject: Re: too many motion notify events Message-ID: <214@tityus.UUCP> Date: 14 Dec 88 19:33:20 GMT References: <8812132316.AA05716@sparky> Organization: Athena Systems, Inc., Sunnyvale, CA Lines: 31 From article <8812132316.AA05716@sparky>, by jdi@sparky.UUCP (John Irwin): > > Has anyone else seen cases where motion events go on "too long" after a button > is released? For example: Drag a window with uwm; release the button > and continue to drag the mouse. Sometimes I have the window keep moving > with the mouse *after* I've released the button. Although this is a guess, it is possible that the software processing the motion events is doing an XQueryPointer() to get the current mouse coordinates (rather than those in the XEvent structure). This is actually sometimes needed if the application and/or server is having problems keeping up with the user. If the processing was fast enough, this would not be needed, but that isn't always the case. If this is the case, a simple check of the mouse button mask could shortcut the operation. (i.e. -- check the "state" returned from XQueryPointer() to see if the buttons are still down). In my own personal case I have taken out usage of MouseMotion events. If I wish to track what the user is going I go into a (ugghh) polling loop while the mouse button is down of doing XQueryPointers(). The numbers are always current and there is no latency problem after the button is released. I didn't originally do this, but scrollbars and popups work a lot better with this type of logic. And the user has Full control! > > -- John -Jim Becker