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

**URL:** <https://forums.unrealengine.com/t/cant-specify-custom-window-positions-in-windowed-mode/403001>\
**Category:** Platform & Builds\
**Tags:** window, command-line-argumen, unreal-engine, packaged-game, bug-report, slate, question\
**Created:** [August 27, 2017, 7:34pm UTC](https://forums.unrealengine.com/t/cant-specify-custom-window-positions-in-windowed-mode/403001 "2017-08-27T19:34:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayamashev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ayamashev](https://forums.unrealengine.com/u/ayamashev)\
**Post date:** [August 27, 2017, 7:34pm UTC](https://forums.unrealengine.com/t/cant-specify-custom-window-positions-in-windowed-mode/403001/1 "2017-08-27T19:34:54Z")

</div>

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:

> **[Commandline -WinX -WinY don't work (get overridden)](https://forums.unrealengine.com/questions/617643/commandline-winx-winy-dont-work-get-overridden.html)**
>
> I'm using 4.16.1 and making a multiplayer game that I need to test via standalone fairly often, so I have a shortcut each for server and client launch, where I attempt to place the windows using commandline e.g.: UE4Editor.exe "" MainMenu -game...

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d2b909bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d2b909bf](https://forums.unrealengine.com/u/anonymous_user_d2b909bf)\
**Post date:** [November 29, 2017, 9:35pm UTC](https://forums.unrealengine.com/t/cant-specify-custom-window-positions-in-windowed-mode/403001/2 "2017-11-29T21:35:51Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![ayamashev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ayamashev](https://forums.unrealengine.com/u/ayamashev)\
**Post date:** [November 29, 2017, 10:48pm UTC](https://forums.unrealengine.com/t/cant-specify-custom-window-positions-in-windowed-mode/403001/3 "2017-11-29T22:48:13Z")

</div>

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

[![]( " - YouTube") ](https://www.youtube.com/watch?v=SHD8VM2mRS4)

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d2b909bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d2b909bf](https://forums.unrealengine.com/u/anonymous_user_d2b909bf)\
**Post date:** [November 30, 2017, 2:12pm UTC](https://forums.unrealengine.com/t/cant-specify-custom-window-positions-in-windowed-mode/403001/4 "2017-11-30T14:12:41Z")

</div>

Hello again,

I was able to reproduce the issue you are experiencing, and have logged a report for it here:

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-52873)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

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!

---

<div class="post-metadata">

**Author:** ![GrumpyOldBear2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrumpyOldBear2](https://forums.unrealengine.com/u/GrumpyOldBear2)\
**Post date:** [December 6, 2017, 3:37pm UTC](https://forums.unrealengine.com/t/cant-specify-custom-window-positions-in-windowed-mode/403001/5 "2017-12-06T15:37:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hrafnaass](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hrafnaass](https://forums.unrealengine.com/u/Hrafnaass)\
**Post date:** [May 9, 2018, 6:47am UTC](https://forums.unrealengine.com/t/cant-specify-custom-window-positions-in-windowed-mode/403001/6 "2018-05-09T06:47:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [May 11, 2018, 1:55pm UTC](https://forums.unrealengine.com/t/cant-specify-custom-window-positions-in-windowed-mode/403001/7 "2018-05-11T13:55:54Z")

</div>

Hi Hrafnaass,

If you’re still running into this issue, feel free to report it using the new [Bug Submission Form](https://epicsupport.force.com/unrealengine/s/) and we’ll be glad to take a look and follow up with you.

Thanks,

Sean
