Can't specify custom window positions in 'windowed' mode

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:

  1. Package any template project
  2. Launch with arguments mentioned above
  3. Check out if game window has specified location and dimensions

Hello Ayamashev,

I was unable to reproduce the issue you are experiencing. I have a couple of questions to help narrow down the issue you are experiencing.

  1. Where are you running the arguments for the packaged game?
  2. Has this issue occurred to you in 4.18 using the same repro steps?

Thank you!

Hello ,

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.

Hello again,

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.

Thanks!

This issue has been fixed in CL 3791597 and will be included in 4.19

This issue persists in UE 4.19.2-4033788

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.

Hi Hrafnaass,

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.

Thanks,

Sean