9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.64k stars 326 forks source link

9term keeps showing rio's button 3 menu until another button is pressed #356

Open pmikkelsen opened 4 years ago

pmikkelsen commented 4 years ago

When running 9term under rio and right-clicking, the mouse event is sent to rio instead of 9term via bouncemouse(). If nothing is selected in the menu, I don't think that 9term ever gets a button release event, so every time the mouse moves the menu pops up again. If i press another mouse button right after the rio menu closes, or choose to do something with the window (resize, move) there are no problems.

This happens on fedora 31.

I have tried to dig into the code but without luck, as I couldn't find a way to send a button release event to 9term without removing the focus from rio's menu.

Please let me know if there is something I can do to help.

mk-f commented 4 years ago

I experience something similar, except that even after doing something with the window (resize, move) the menu will pop up again at which point the 9term is unusable. If I then change to another window, the menu will reappear as soon as i switch back to the 9term in which i opened the menu in the first place. f6c9f7b14c9dce53fff6020200b28c4e25621e87, OpenBSD 6.6-current

ghost commented 4 years ago

Same happens in void-linux, and not only in rio, but with any wm that uses right-click on root window.

ghost commented 3 years ago

I just removed the else bouncemouse() fallback branch from mousethread() in my fork and the issue is gone. Maybe I'm wrong, but I see no reason why we should pass through mouse events that are not of interest to 9term when 9term has focus.

markvanatten commented 3 years ago

It is just convenient to be able to access rio without first having to move the mouse to some free background outside the 9term window, especially if most of your screen estate is being used. But it is good to have your patch; occasionally I hit B3 within 9term by accident, and then the behaviour under discussion is annoying indeed.

ghost commented 3 years ago

@markvanatten ICYMI, you don't need to use B3 on the background, necessarily, just on any non-focused window, including 9terms. The fact that B3 on 9term pops up the rio menu even if it's focused (without removing the bouncemouse call) is an exception to the rule, AFAICS.

ghost commented 3 years ago

BTW @markvanatten a workaround (in case you hit b3 on 9term and you keep bouncemouse) you can move the pointer to the 9term scrollbar and click another button.

markvanatten commented 3 years ago

You are completely right!