From 1dc97f1825394034c06bee9b4b1af283687c48a5 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 24 Jan 2018 17:33:56 +0100 Subject: [PATCH] Tooltip text is also set on menu creation, if necessary --- src/dorkbox/systemTray/ui/swing/_SwingTray.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dorkbox/systemTray/ui/swing/_SwingTray.java b/src/dorkbox/systemTray/ui/swing/_SwingTray.java index 0255957..2fa54e0 100644 --- a/src/dorkbox/systemTray/ui/swing/_SwingTray.java +++ b/src/dorkbox/systemTray/ui/swing/_SwingTray.java @@ -124,9 +124,10 @@ class _SwingTray extends Tray { popupMenu.pack(); popupMenu.setFocusable(true); - // appindicators DO NOT support anything other than PLAIN gtk-menus (which we hack to support swing menus) - // they ALSO do not support tooltips, so we cater to the lowest common denominator - // trayIcon.setToolTip("app name"); + // appindicators DO NOT support anything other than PLAIN gtk-menus, which do not support tooltips + if (tooltipText != null && !tooltipText.isEmpty()) { + trayIcon.setToolTip(tooltipText); + } trayIcon.addMouseListener(new MouseAdapter() { @Override