Re: mask_return mystery in XQueryPointer()
Re: mask_return mystery in XQueryPointer()
- Subject: Re: mask_return mystery in XQueryPointer()
- From: Jeremy Huddleston <email@hidden>
- Date: Tue, 08 May 2012 11:44:40 -0700
On May 8, 2012, at 11:04 AM, René J.V. Bertin <email@hidden> wrote:
>>> In other words, the information contained in the event state variable and in the mask_return argument to XQueryPointer is not consistent among event types.
>>
>> You should have this discussion on xorg-devel since this is not an issue specific to XQuartz.
>
> Can we be sure?
Yes.
> This is old code I inherited. It handles mouse actions (zooming, selecting etc) in a close loop inside of which it does an XGrabPointer and XGrabKeyboard (which appear to be required to the code to work). The XQueryPointer calls are done exactly for the reason to know the pointer's current state, which might well be not be the one contained in the last received event.
Well, you inherited broken code. That's not how events are to be handled. You need to get the data from the event itself, not waste a round trip to the server to get a more recent/conflicting state. Events are sent in-order. Your application should not need to know about the mouse state "in the future" ... you'll get that event when you're told about it. Doing things like this leads to bugs like this.
> However, I don't expect the phenomenon I described when I press and hold Shift-Mod1, then click Button1 all while holding Shift-Mod1 until I release Button1.
That is because you probably have 3-button emulation enabled. That coupled with the buggy event handling code would explain your inconsistencies.
> Also, what I described occurs only when I hold Mod1, possibly with the Shift key held too. Mod2 with modifiers works as expected, and Mod1 with Control works as expected too. (And this code also worked perfectly under OS X 10.4.11 with its own X11 server.)
Yes, this is consistent with my hunch above.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden