I'm currently working on a desktop game that can be played in both fullscreen, as well as windowed mode. When the game is windowed, I want to ensure that the window always maintains a certain aspect ratio, while still allowing the user to resize the window.
To describe the flow: after the user resizes the window, the width and height will adjust to snap to a pre-defined aspect ratio. An example of this is the game Stardew Valley. When you try to resize the window to a small enough size, after letting go of the mouse button, the window resizes (grows) to a pre-defined minimum size.
The approach I want to take is to detect when the user is finished resizing the window, and then set the window size manually. But I'm not sure how to detect that end "event."