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 2ed30c56cd
commit 07fbe3438a

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(); }));