Notify about messages when out of focus

This commit is contained in:
Kai S. K. Engelbart 2020-07-23 19:20:58 +02:00
parent 1d706c14f2
commit d030a866dd
No known key found for this signature in database
GPG Key ID: 0A48559CA32CB48F

View File

@ -60,7 +60,8 @@ public class StatusTrayIcon {
trayIcon.setPopupMenu(popup);
// Only display messages if the stage is not focused
stage.focusedProperty().addListener((ov, onHidden, onShown) -> displayMessages = ov.getValue());
stage.focusedProperty().addListener((ov, onHidden, onShown) -> displayMessages = ov.getValue() == Boolean.FALSE);
// Show the window if the user clicks on the icon
trayIcon.addActionListener(evt -> Platform.runLater(() -> { stage.setIconified(false); stage.toFront(); stage.requestFocus(); }));