XUngrabPointer(_x.display, m->msec);
XSendEvent(_x.display, e.root, True, ButtonPressMask, (XEvent*)&e);
After button 3 is pressed once in the client, the window manager
button 3 menu is posted; after dismissing the menu, the next
pointer movement immediately posts this menu again. That is,
the loop in the client that waits on mouse events, is getting
a ButtonPress event. While the window manager menu is posted,
I'll provide the code. The program is '9term' and it is
written threaded. The thread handling the mouse events is
thus:
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.
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?
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?
Not really. I'd find out why release events aren't being reported, and
fix that:) Or fix the code event to plan9 code that isn't correctly
setting the mouse structure.
I suspect you know a lot more about X11 programming than I do
hence I am asking you.
On 2017-05-20, Noel Hunt <NigelLuxuryYacht@gmail.com> wrote:
I suspect you know a lot more about X11 programming than I do
hence I am asking you.
Not much - I haven't written an Xlib program since about 1990, though
I've occasionally fixed things.
At this point, I would need to go and read the manuals, but you can do
that as well as I can.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 84:35:03 |
Calls: | 8,091 |
Files: | 13,069 |
Messages: | 5,851,128 |