Terminal.Gui: Sometimes controls don't activate on mouse clicks
This is really tricky to reproduce and I have not yet found a reliable way of reproducing it with the debugger.
- Run
demo.cin cmd.exe or ConEmu on Windows (any terminal that supports mouse). - Click on any control (e.g. a top-level
MenuBarItemor one of the radio buttons. - Click on another control.
- Then another …
- Eventually you’ll notice one of your clicks does nothing; the target control does not get focus as expected. Clicking again will work.
- You’ll think you’re crazy and you just either didn’t hit the mouse button hard enough or missed the hit-target. But you didn’t.
- You’ll try again and find you can’t precisely reproduce it the same way.
P.S. I thought I had introduced this bug in my upcoming MenuBar PR and was actually quite happy to find it also exists in the current master and that it exists across all controls.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 24
Commits related to this issue
- Improves mouse performance #386. Provides a better async call. Ensures all the cycles of a simple click (Pressed, Released and Clicked). Only clears selected text if other view than MenuBar get focus... — committed to gui-cs/Terminal.Gui by BDisp 4 years ago
- Fixes #386. Window can now be dragged inside another Window. — committed to BDisp/Terminal.Gui by BDisp 4 years ago
- Merge pull request #752 from BDisp/windows-dragging Fixes #386. Window can now be dragged inside another Window. — committed to gui-cs/Terminal.Gui by tig 4 years ago
I think it is fixed. It was hard to reproduce before, and I’ve been trying since @bdisp made his latest changes that fixed some window dragging issues…I think they were the root cause.
Note that mouse is still broken in Windows Terminal. This is for all GUI apps, and is not specific to
Terminal.Gui.But it is only working on Windows 10. Still working on Curses.
For me it is working well in
WindowsandLinux. I don’t have aMac.Yes. But I think @tig still detects some strange behavior.
There is a new version that was merged today. I think it’s more functional.
Sometimes we think that we are clicking on the right place, for example in MenuBar we have to click on the letters and not outside. But it also happens to me a lot to make sure I clicked correctly and didn’t get any action. I think that sometimes handlers become irresponsible and do not return certain actions.