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

As of FlatLaf 1.3, clicking a JMenuItem(Action) while pressing a modifier key like SHIFT or CTRL has no special effect #371

Closed
hshafie opened this issue Aug 10, 2021 · 4 comments
Milestone

Comments

@hshafie
Copy link

hshafie commented Aug 10, 2021

Hello,

As of FlatLaf 1.3, clicking a JMenuItem(Action) while pressing a modifier key like SHIFT or CTRL has no special effect. I mean: ActionEvent.getModifiers() always returns 0.

See attached Test.java. Test.java.gz

Compile it using:
javac -cp "flatlaf-1.5.jar:." Test.java

Run it using:
java -cp "flatlaf-1.5.jar:." Test

Run it with default LaF using:
java -cp "flatlaf-1.5.jar:." Test -noflatlaf

Additional info:

  • I did my tests on my Linux box. I can also test this on Windows if you want.
  • There is no such problem with Java 8, only with Java 11 or Java 16.
  • There is no such problem with the Metal LaF whatever the version of Java.
  • This feature used to work fine with FlatLaf 1.2 whatever the version of Java.

Thank you for your beautiful LAF!

@DevCharly
Copy link
Collaborator

Can reproduce it. Occurs only with heavy-weight popups (default on Linux and macOS; on Windows only for large popups that do not fit into the window).

This line is responsible:

root.addHierarchyListener( hierarchyListener );

Added in commit 7b24842 for FlatLaf 1.3

But have no idea why adding an hierarchy listener has this effect...

@hshafie
Copy link
Author

hshafie commented Aug 11, 2021 via email

DevCharly added a commit that referenced this issue Aug 13, 2021
@DevCharly
Copy link
Collaborator

Fixed in main branch.

https://github.com/JFormDesigner/FlatLaf#snapshots

@DevCharly DevCharly added this to the 1.6 milestone Aug 13, 2021
@hshafie
Copy link
Author

hshafie commented Aug 14, 2021

Wow, not an easy fix! Thank you so much!

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