Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!dont-send-mail-to-path-lines From: Stuart.Marks@eng.sun.COM (Stuart Marks) Newsgroups: comp.windows.x Subject: Re: OpenWindows button events question Message-ID: <9104162044.AA27125@trantor.Eng.Sun.COM> Date: 16 Apr 91 20:44:06 GMT References: <9104130056.AA08365@lightning.McRCIM.McGill.EDU> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 51 >> der Mouse: >> This strikes me as a bad way of doing things. It means that your >> application does not have the automatic passive grab you normally >> would for a button press, > smarks: > Nope. The semantics of AllowEvents(ReplayPointer) are that windows > further down in the hierarchy can also have passive grabs activated. der Mouse: The order of the ButtonPress and EnterNotify events implies that the reprocessing is happening before olwm's grab is being released. Does this then imply that there can be two pointer grabs active at once? No. The event sequence from the OpenWindows version 2 server is actually incorrect, which adds to the confusion. The (buggy) event sequence is: LeaveNotify(mode=Grab) ButtonPress EnterNotify(mode=Grab) Even though the event sequence is screwed up, passive grabs on windows further down in the hierarchy are getting activated properly. The correct event sequence is: LeaveNotify(mode=Grab) EnterNotify(mode=Ungrab) ButtonPress >> and it also generates this strange sequence of events implying the >> mouse is not in the window when the press happens. > The sequence if events is indeed strange. As you mention above, > there is enough information in the events for the program to > disambiguate them. This is a lesser complaint; that's why I put it second. As you say, it's not serious, but it really shouldn't be necessary. It might not be necessary in this case. However, in general -- and in the absence of a buggy server -- it is still sometimes necessary for clients to pay attention to the information in the mode field. If the client is (for example) painting a crosshair, it will probably want to disregard Enter and Leave events generated by grabs. s'marks Stuart W. Marks ARPA: smarks@eng.sun.com Windows & Graphics Software UUCP: sun!smarks Sun Microsystems, Inc.