On an MS/Windows platform, when the user changes the window size of my app I capture it in the resize() method. I want to preserve the aspect ratio of the window, so if necessary, I’ll alter its size by calling the setWindowedMode() method. However, when I do that LibGDX then automatically repositions the window to the center of the screen. How can I prevent that repositioning from happening? Or, can I reposition it back myself?
I create a LWJGL3 window to paint my app in using this:
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
config.setWindowedMode( 1900, 980 );
config.setWindowPosition( 10, 40 );
config.setBackBufferConfig( 8, 8, 8, 8, 32, 0, 0 );
config.setResizable( true );
config.setWindowSizeLimits( 400, 400, 1900, 980 );