Skip to content

Commit

Permalink
clientui: setResizable after setVisible
Browse files Browse the repository at this point in the history
Prevents an issue with clients being resizable with toolbar-less means in some environments (e.g. double clicking title bar on macos).

Honestly I'm not entirely sure why this is ignored if the window isn't visible, rather than being propagated to the window manager when the window is shown, but I guess Swing isn't that smart (like always).

I originally found the information on [this SO answer](https://stackoverflow.com/a/14884056) and it seemed to resolve the issue.

Closes runelite#14235
  • Loading branch information
LlemonDuck authored and Adam- committed May 14, 2022
1 parent b8188d2 commit 2cc34b9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public void layoutContainer(Container parent)
}

// Update config
updateFrameConfig(true);
updateFrameConfig(false);

// Create hide sidebar button

Expand Down Expand Up @@ -596,6 +596,8 @@ public void show()

// Show frame
frame.setVisible(true);
// On macos setResizable needs to be called after setVisible
frame.setResizable(!config.lockWindowSize());
frame.toFront();
requestFocus();
log.info("Showing frame {}", frame);
Expand Down

0 comments on commit 2cc34b9

Please sign in to comment.