diff --git a/src/dorkbox/systemTray/swing/TrayPopup.java b/src/dorkbox/systemTray/swing/TrayPopup.java index 096eb04..b47f699 100644 --- a/src/dorkbox/systemTray/swing/TrayPopup.java +++ b/src/dorkbox/systemTray/swing/TrayPopup.java @@ -140,7 +140,7 @@ class TrayPopup extends JPopupMenu { hiddenDialog.dispatchEvent(new WindowEvent(hiddenDialog, WindowEvent.WINDOW_CLOSING)); } - void doShow(final MenuImpl systemTray, final Point point, int offset) { + void doShow(final Point point, int offset) { Dimension size = getPreferredSize(); Rectangle bounds = ScreenUtil.getScreenBoundsAt(point); @@ -174,19 +174,14 @@ class TrayPopup extends JPopupMenu { // critical to get the keyboard listeners working for the popup menu setInvoker(hiddenDialog.getContentPane()); + + hiddenDialog.setLocation(x, y); hiddenDialog.setVisible(true); setLocation(x, y); setVisible(true); - // when the menu entries are changed, this makes sure to correctly show them - invalidate(); - revalidate(); - doLayout(); - requestFocusInWindow(); - - ((EntryImpl) systemTray.getFirst())._native.requestFocusInWindow(); } } diff --git a/src/dorkbox/systemTray/swing/_AppIndicatorTray.java b/src/dorkbox/systemTray/swing/_AppIndicatorTray.java index 184faac..8757c22 100644 --- a/src/dorkbox/systemTray/swing/_AppIndicatorTray.java +++ b/src/dorkbox/systemTray/swing/_AppIndicatorTray.java @@ -145,7 +145,7 @@ class _AppIndicatorTray extends MenuImpl { .getLocation(); TrayPopup popupMenu = (TrayPopup) _native; - popupMenu.doShow(_AppIndicatorTray.this, point, SystemTray.DEFAULT_TRAY_SIZE); + popupMenu.doShow(point, SystemTray.DEFAULT_TRAY_SIZE); } }; diff --git a/src/dorkbox/systemTray/swing/_GtkStatusIconTray.java b/src/dorkbox/systemTray/swing/_GtkStatusIconTray.java index 76426ad..298e84f 100644 --- a/src/dorkbox/systemTray/swing/_GtkStatusIconTray.java +++ b/src/dorkbox/systemTray/swing/_GtkStatusIconTray.java @@ -81,7 +81,7 @@ class _GtkStatusIconTray extends MenuImpl { .getLocation(); TrayPopup popupMenu = (TrayPopup) _native; - popupMenu.doShow(_GtkStatusIconTray.this, point, 0); + popupMenu.doShow(point, 0); } }; diff --git a/src/dorkbox/systemTray/swing/_SwingTray.java b/src/dorkbox/systemTray/swing/_SwingTray.java index 3f39461..9f631e8 100644 --- a/src/dorkbox/systemTray/swing/_SwingTray.java +++ b/src/dorkbox/systemTray/swing/_SwingTray.java @@ -100,7 +100,7 @@ class _SwingTray extends MenuImpl { public void mousePressed(MouseEvent e) { TrayPopup popupMenu = (TrayPopup) _native; - popupMenu.doShow(_SwingTray.this, e.getPoint(), 0); + popupMenu.doShow(e.getPoint(), 0); } });