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

GH-628 Use generic context menu mouse event instead of right click event #183

Merged
merged 2 commits into from May 29, 2022

Conversation

tortmayr
Copy link
Contributor

  • Update to latest sprotty version
  • Update SelectionServiceAwareContextMenuMouseListener to use the contextmenu mouse event instead of the right-click event.

Fixes eclipse-glsp/glsp#628

- Update to latest sprotty version
- Update `SelectionServiceAwareContextMenuMouseListener` to use the `contextmenu` mouse event instead of the `right-click` event.

Fixes eclipse-glsp/glsp#628
Sprotty only updates the selection on mouse button 0 (left-click).
However, this is actually inconsistent with other software's behavior
as they usually update the selection on any mouse click.

If we do the same GLSP editors behavior much more consistently
and we also can get rid of  the special case of context menu invocation.
Copy link
Member

@planger planger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks! Now also the context-menu button on the keyboard works! 👍

However, I found an issue:
If you select an element first (left-click) and then right-click on another element, the previous element is not unselected. So if you now select "Delete" from the context menu, the previously selected element is also deleted.

Imho this is a bit unexpected.

I suggest that we now modify the select mouse tool to also update the selection on any other mouse click (not just mouse button 0 === left-click). This is actually more consistent with other software, if you e.g. try a right-click or even wheel click in VS Code you'll see that it updates the selection too). This makes also the special handling regarding the selection in the context menu listener obsolete.

I'll append a commit for you to review.

@tortmayr
Copy link
Contributor Author

Thanks. Looks good to me!

@tortmayr tortmayr merged commit 82afe91 into master May 29, 2022
@tortmayr tortmayr deleted the gh-628 branch August 23, 2022 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Context menu does not open on MacOS
2 participants