From 8d58e7928bebafcb8b59b7d27e39837f9bd6ae2c Mon Sep 17 00:00:00 2001 From: Lyn Levenick Date: Mon, 26 Mar 2018 18:13:49 -0500 Subject: [PATCH] Fix tray icon crash when clicked quickly on start SwingUtil adds a click event to focus the frame, but the frame isn't fully built when the icon is created. Click after the icon was made and before the frame was built caused a crash. Moved icon creation to after the frame is built, should resolve the problem. --- .../src/main/java/net/runelite/client/ui/ClientUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java index 9fe50779a9..af31b90256 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java @@ -301,8 +301,6 @@ public class ClientUI // Try to enable fullscreen on OSX OSXUtil.tryEnableFullscreen(frame); - trayIcon = SwingUtil.createTrayIcon(ICON, properties.getTitle(), frame); - frame.setTitle(properties.getTitle()); frame.setIconImage(ICON); frame.getLayeredPane().setCursor(Cursor.getDefaultCursor()); // Prevent substance from using a resize cursor for pointing @@ -399,6 +397,8 @@ public class ClientUI frame.toFront(); requestFocus(); giveClientFocus(); + + trayIcon = SwingUtil.createTrayIcon(ICON, properties.getTitle(), frame); }); eventBus.post(new ClientUILoaded());