Calling UGameUserSettings::ApplySettings forces the dimensions of a PIE window

(We use Unreal 5.5, but I confirmed this happens in 5.6 too)

Seems that when you apply settings (`UGameUserSettings::ApplySettings`), even if you’ve not made any changes to the screen/resolution, it forces the screen window to change size (see footage attached). This can be pretty frustrating when testing multiple clients in-editor.

Looking at the logic, it seems to be due to `RequestResolutionChange(ResolutionSizeX, ResolutionSizeY, NewFullscreenMode, bCheckForCommandLineOverrides);` being called in `UGameUserSettings::ApplyResolutionSettings`.

Any advice for this? It would be ideal if this `ApplySettings` logic took into account the current window’s size (and/or fullscreen state). Seems currently it uses the screen’s resolution - in `ValidateSettings`, it sets your resolution in your settings to the system resolution: `SetScreenResolution(FIntPoint(GSystemResolution.ResX, GSystemResolution.ResY));`

Steps to Reproduce
This is a test project built off of UE5.6. it has a character which on SpaceBar calls `GetGameUserSettings`, then `ApplySettings`.

If you PIE with one client as a new window, either by selecting “New Editor Window (PIE)”, or leaving it as “Selected Viewport”, but increasing the number of players to 2, then if you select the window and press spacebar, it fullscreens the window.

This seems to be worse in 5.5, where instead of fullscreening, it makes the screen windowed, but the size of the entire screen, and seems to not let you move or resize it

Hi [Content removed]

In C++, you can create a workaround for this. There is a function called UGameUserSettings::ApplyNonResolutionSettings that applies your settings without making any resolution changes. Another option is to override UGameUserSettings::ApplySettings.

While in the editor, if this function gets called and the target window is in Windowed mode, you can call ApplyNonResolutionSettings instead. For normal windows or packaged applications, you can still call UGameUserSettings::ApplySettings as usual.

Let me know if this works for your case :slightly_smiling_face:

Best,

Joan

Thanks Joan! I tried skipping `ApplySettings`, and instead calling `ApplyNonResolutionSettings` - seems that does indeed do the trick!

Note that it also requires calling `SaveSettings` if you want your settings to save, since that’s only done within the root `ApplySettings` call.

[Image Removed]This workaround resolves the issue for us, but out of interest: is this the intended behavior of `ApplySettings` then (forcing a windowed application to fullscreen)? Seems like an unintentional side-effect to me, and having to separate out and call individual parts of the `ApplySettings` function to work around it isn’t ideal. Could be a bug, to look into in a subsequent UE update?

Cheers,

Ben

Hi Ben!

Glad to hear that it worked for you. From what I was able to debug, the program is simply pulling the resolution values and the window mode from the project’s GameUserSettings.

In my case, GameUserSettings was set to Windowed Fullscreen with a 2K resolution (my main monitor). So when ApplySettings is called, it makes sense that the window gets scaled, it’s just applying those stored settings.

If you maintain a separate UGameUserSettings instance for each client, the window size and resolution should remain consistent for each one.

Thanks Joan! Yeah, that matches what I was seeing - does seem that these user settings are somewhat outside of the user’s control though - they are filled automatically during startup to the system’s resolution (`SetScreenResolution(FIntPoint(GSystemResolution.ResX, GSystemResolution.ResY));`)

So if I e.g. try launching multiple clients in-editor, whenever I call apply settings, it reads this pre-recorded resolution, regardless of the current window size.

Totally Ben. Happy you could go through your issue :grinning_face_with_smiling_eyes: Will close the case for now but feel free to open it again if needed for a related reason to the case.

Best,

Joan