Why would setting game's screen resolution in GameUserSettings affect Editor's Application Scale?

I’m developing on Windows 8.1, using a dual-booted Retina MacBook Pro. Since the screen resolution is 2880x1800, I have Desktop Scaling turned on at 200% for the laptop monitor.

I haven’t had a problem with the Editor scaling correctly, until I began writing code for my game that sets the game’s resolution, and sets it to Windowed Full Screen. Now whenever I launch the Editor, even not in that project, the Editor’s Widget scaling is set to 1.0, completely ignoring the desktop scaling. This makes the Editor unusable, unless I manually set the Widget Scaling, per the instructions in this forum post: High resolution display support for editor - Feedback & Requests - Epic Developer Community Forums

Here is the code that sets my game’s resolution:

void UGameUserSettingsFuncLib::SetFullscreenAtResolution(FIntPoint ScreenResolution)
{
     GEngine->GameUserSettings->SetScreenResolution(ScreenResolution);
     GEngine->GameUserSettings->SetFullscreenMode(EWindowMode::WindowedFullscreen);
     GEngine->GameUserSettings->SetWindowPosition(-1, -1);
     GEngine->GameUserSettings->ApplySettings(false);
     GEngine->GameUserSettings->ConfirmVideoMode();
}

Also, when I update the Widget Scaling in the Widget Reflector menu, the setting isn’t saved; so the next time I open the Editor, whether on the project I wrote the above code, or in a brand new blank project, it’s back to a scale of 1.0.

Is this a bug, or are these settings somehow tied together? And how can I avoid having to set the Application Scale every time I open the Editor to work on a project?

The WidgetReflector settings are not saved. The widget reflector is a developer tool; it isn’t meant as a proper DPI scaling setting. Rather, it is a way for you to play around with various scaling settings and ensure that any widgets you are authoring work correctly.

The editor does not currently respect the OS’s DPI setting. There IS a mechanism that scales game content based on resolution. You can read more about it here: DPI Scaling | Unreal Engine Documentation

Meanwhile, all the underpinnings for respecting the OS’s DPI scale are there. You should be able to hack it real quick by calling FSlateApplication::Get().SetApplicationScale(2.0f).

EDIT: One caveat is that the editor has not been extensively tested with non-1 DPI scales. You may find some bugs specific to the editor app. If you do, we’d love for you to report them so that we can get on fixing them.

Wherever you want to do it. It’s pretty much completely dynamic, so it should just take effect next frame.

Thanks for the info. Where would I put that code? In a plugin, Blutility, etc. …

Is the setting persistent? Or will I need to set it each time I open the Editor?

Ok. Thanks for the info. Definitely a feature request to make it persistent.

The Editor was scaling correctly at one point, it was only after I started adjusting my game’s resolution settings in code that the Editor no longer scaled. Oddly enough the Epic Launcher scales correctly, it’s just the Editor that no longer scales.

I’ve set the application scale in the Widget Reflector menu to 2.0 since I posted this question. And it works, but there are some visual issues. I’m away from my computer at the moment, but I can post some screenshots of issues I’ve seen.

Let me know if you want me to post the screenshots to this thread, or if you want me to start a new thread.

It is not persistent. You’d have to set it each time. It IS the very same setting that the widget reflector drives.

One caveat is that the editor has not been extensively tested with non-1 DPI scales. You may find some bugs specific to the editor app. If you do, we’d love for you to report them so that we can get on fixing them.

If you aren’t finding any bugs at all, please let us know that as well. We’ll just make it persistent them. Until that time, you’re kind of an early adopter of the feature.