On Friday, May 19, 2017 at 6:45:01 PM UTC+10, Julian Bradfield wrote:
This may be too easy to be true, but:
is mouse->buttons the button detail from a ButtonPress event, or is it
the button component of the pointer state? If the latter:
the 9term loop doesn't check whether the event is a ButtonPress event,
it just checks whether a button is down; while the bouncemouse event
doesn't bounce the actual event, it just sends a ButtonPress.
So if you press the button, and then the mouse moves at all, a
MotionNotify event comes through with button3 down, and then
bouncemouse sends a ButtonPress event.
The code in the process which translates X11 events to Plan9
structures is this;
case ButtonPress:
be = (XButtonEvent*)xev;
if(be->button == 1) {
if(kstate & ControlMask)
be->button = 2;
else if(kstate & Mod1Mask)
be->button = 3;
}
// fall through
case ButtonRelease:
altdown = 0;
// fall through
case MotionNotify:
if(mouse.stall)
return;
if(_xtoplan9mouse(xev, &m) < 0)
return;
sendmouse(m);
break;
'm' is a Plan9 mouse structure, and it is static.
struct Mouse
{
int buttons; /* bit array: LMR=124 */
Point xy;
ulong msec;
};
Just put some more fprint's into the drawing process and it
seems that ButtonRelease events are not being reported for
Button 3. If I look at button 2 events, Press and Release are
reported for the client but not button 3.
I assume this is the problem. The client gets a button 3 press
event, passes this event with XSendEvent to the root window,
but never gets a ButtonRelease. Since 'm' is static, the
button 3 flag is never cleared until another button press
event clears it.
So, have you any suggestions as to how to fix this? Should
the window manager detect it has received an event from the
client and send back the ButtonRelease?
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)