Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Avoid triggering popup menu action from mouse-release shortly after mouse-press #963

Open
eirikbakke opened this issue Jan 27, 2025 · 2 comments

Comments

@eirikbakke
Copy link
Contributor

On Windows, popup menus appear when releasing the right-click button. On MacOS, they appear when pressing the right-click button. FlatLAF correctly follows this behavior on each platform.

There's a usability problem on MacOS, though. If the user moves the cursor towards the intended menu item, and happens to release the mouse button while the cursor is now over another menu item, then the latter action will be executed instead of the intended one. I make this mistake myself quite often when working quickly (with an external mouse, not a trackpad). See the screen recording below:

https://youtube.com/shorts/RzlnnRMP8J8

Proposal: In a JMenuItem, ignore a right-button mouse-release event for action triggering purposes if it comes within a short duration of the corresponding mouse-press event (e.g. 250ms).

@DevCharly
Copy link
Collaborator

But isn't this a general "problem" when using right-mouse-press-hold-and-move-and-release on macOS.
This can also happen in any native macOS app, right?

Proposal: In a JMenuItem, ignore a right-button mouse-release event for action triggering purposes if it comes within a short duration of the corresponding mouse-press event (e.g. 250ms).

Not sure whether this would help 😕
I mean you can accidentally release the mouse button also after the 250ms...

@eirikbakke
Copy link
Contributor Author

This can also happen in any native macOS app, right?

Yes, correct! This would be an improvement over MacOS defaults. Just a bonus feature, so to speak. (I considered implementing it myself and submitting a PR, but thought I'd solicit your opinion.)

I mean you can accidentally release the mouse button also after the 250ms...

There's a certain threshold of time before which it is reasonable to assume that the user is trying to click, rather than drag. Above that threshold, it is reasonable to assume the user is trying to drag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants