clientui: setResizable after setVisible

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 #14235
This commit is contained in:
LlemonDuck
2022-05-12 20:58:06 -07:00
committed by Adam
parent b8188d27e3
commit 2cc34b9ece

View File

@@ -488,7 +488,7 @@ public class ClientUI
}
// Update config
updateFrameConfig(true);
updateFrameConfig(false);
// Create hide sidebar button
@@ -596,6 +596,8 @@ public class ClientUI
// 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);