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

Switch and close tabs on left mouse click only #595

Merged
merged 1 commit into from Sep 30, 2022

Conversation

ShadelessFox
Copy link
Contributor

It feels more natural when right/middle mouse clicks don't do anything when you click on a tab.

@webfolderio
Copy link

This should be configurable.

@DevCharly
Copy link
Collaborator

This should be configurable.

Why?

@DevCharly DevCharly merged commit 0699454 into JFormDesigner:main Sep 30, 2022
@DevCharly DevCharly added this to the 3.0 milestone Sep 30, 2022
@DevCharly
Copy link
Collaborator

It feels more natural when right/middle mouse clicks don't do anything when you click on a tab.

Thanks. You're right.
Nearly all Swing components respond only to left clicks.
Only exception I've found so far are split pane divider and menus.

I think it is a bug in all Swing L&F to switch tabs on right/middle mouse click.
This becomes a real problem when you add a mouse listener to the tabbed pane and
want show a context menu for tabs on right-click.
Without this PR, the right-clicked tab is always selected. There was no way to prevent this.
With this PR, the app can control whether it want select the clicked tab or not.

Tried several Windows and macOS apps that have tabs.
All show a context menu on clicked tab, but do not select/activate that tab.

@DevCharly DevCharly modified the milestones: 3.0, 2.6 Oct 17, 2022
DevCharly added a commit that referenced this pull request Oct 17, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants