From 07fbe3438a659da3c7a79c4234034f5d6e8c27f5 Mon Sep 17 00:00:00 2001 From: kske Date: Thu, 23 Jul 2020 19:20:58 +0200 Subject: [PATCH] Notify about messages when out of focus --- client/src/main/java/envoy/client/ui/StatusTrayIcon.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/main/java/envoy/client/ui/StatusTrayIcon.java b/client/src/main/java/envoy/client/ui/StatusTrayIcon.java index f60645a..80a83db 100644 --- a/client/src/main/java/envoy/client/ui/StatusTrayIcon.java +++ b/client/src/main/java/envoy/client/ui/StatusTrayIcon.java @@ -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(); }));