Don't force focus on tray icon click on macOS when already focused

This commit is contained in:
testing-ongithub
2022-01-04 18:17:09 -05:00
committed by Adam
parent 060cb31a6c
commit b0234eb013
@@ -184,7 +184,7 @@ public class SwingUtil
@Override @Override
public void mouseClicked(MouseEvent e) public void mouseClicked(MouseEvent e)
{ {
if (OSType.getOSType() == OSType.MacOS) if (OSType.getOSType() == OSType.MacOS && !frame.isFocused())
{ {
// On macOS, frame.setVisible(true) only restores focus when the visibility was previously false. // On macOS, frame.setVisible(true) only restores focus when the visibility was previously false.
// The frame's visibility is not set to false when the window loses focus, so we set it manually. // The frame's visibility is not set to false when the window loses focus, so we set it manually.