The problem appeared in UE4.16 and still exists (4.17.1).
Description:
When packaged game is launched with custom location and size in windowed mode (for example with arguments “-windowed WinX=50 WinY=50 ResX=800 ResY=600”) the window appears as specified but then immediately jumps to the center of screen. I actively used this feature with 4.15 but now I have to look for some workarounds.
Some discussion is here:
Steps to reproduce:
Package any template project
Launch with arguments mentioned above
Check out if game window has specified location and dimensions
I’ve just built the template FPS project in UE4.18.1 (Epic’s version). No additional changes were made. I launch it with custom window size and location which are specified by arguments in command line. Watch the video below.
Expected behavior: the window remains in top left corner at location X=100,Y=100
I think this is good idea to place the window at center when you have ‘-windowed’ argument only. As I said before this bug appeared in UE4.16.
I was able to reproduce the issue you are experiencing, and have logged a report for it here:
You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.
edit: It does work if you specify the same resolution as specified in-game via the r.SetRes console command. If one does not specify a -WinX and -WinY, or if one specifies a different resolution, the resolution change will trigger the window to be reset to the centre of the screen.
This is therefore not a problem if one is using a fixed resolution. For myself however, I am developing an app to run on a whole host of different resolutions (from 1280x720 to 5120x2880). I have made a function to detect the native desktop resolution (or scaled in the case of 4k or 5k monitors), and I then r.SetRes to approx. 2/3 of the height of the screen (or closest 9:16 resolution). As such, having a fixed resolution is not an option for me.
If you’re still running into this issue, feel free to report it using the new Bug Submission Form and we’ll be glad to take a look and follow up with you.