From d030a866dda8a1c5a188b6de3d293decba532c52 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R 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(); }));