Mouse input is offset in UMG/Slate when the resolution/ViewportSize is changed at run-time (Standalone Game)

Hey guys,

We’re currently working off of 4.8.2, and I’ve found that when re-sizing the View-port in the standalone version of the game, it causes the mouse input to be offset in UMG/Slate.

It seems as though the new view-port size/Resolution is not being updated in Slate/UMG, and is using the old size to calculate the mouse location, which is incorrect.

Has this been fixed at all in newer versions? if so, what change-list in the Git Repo is the fix?

Cheers.

Hey -

I addeda UMG button to the center of the screen and then using the “setres” console command I tried setting the standalone window to different resolutions. Each time the UMG button would respond to my click when I clicked the center of the screen. If this is not the behavior you’re seeing could you provide reproduction steps for me to create the same setup that you’re using.

Cheers

So after doing some playing around, swapping between full-screen and windowed mode seems to be the actual issue.

So for example, Swapping between the commands “setres 1024x768f” and “setres 1024x768w” causes the issue to happen.

Specifically on the window mode the game did NOT start in. (so if we started in full-screen, then windowed mode has offset issues.)

I’m guessing this might have something to do with Linux not handling Full-screen correctly. (I’ll enter it as another bug.)

Also forgot to mention in the original bug that i’m working on Ubuntu 14.04 LTS.

NOTE: This is easier to see if there is a button highlight on hover over (Something we have in our game)

Hope that helps. :slight_smile:

Hey -

I was able to reproduce this on both Linux as well as Windows and I’ve entered a bug report (UE-19988) for further investigation.

Cheers

I still have this problem. My Unreal Engine version is 4.17.2

Probably a good idea to start a new question in the bug reports section with a link to this question.

Also include the repro steps so they can fix it.

same problem here

So apparently they can’t reproduce this issue…

You’ll need to probably submit a bug and create a new answerhub post.
Hopefully you’ll have better luck getting them to fix this issue than I have…

Why was this marked as “cannot reproduce” when said he could reproduce it?

Can we get more information on this? Are you chalking it up to an issue with Windows and not UE4?

This is still a problem, i’d like to know as well

Bumping this: from my testing it seems that this issue only occurs if you are using a second monitor? When I run my game on my main monitor, it behaves fine, but if I move it to my second monitor and start changing resolution, then the mouse gets super offset.

From what I can tell, whatever is in charge of mouse position uses the resolution of the first monitor, even when the game is running on a different one with a different resolution?

1 Like

@Devolution.exe I’m having big troubles with this still. I have two monitors, where the primary one is a high-DPI model. My issue, in case you (or someone) else discovers a solution:

It is exactly as you describe:

I can start the application perfectly fine on the primary monitor. But if I start on the secondary monitor the mouse coordinates are just wrong. If I switch monitor then sometimes this also messes up the mouse coordinates when switching to the secondary monitor.

There are quite a few variables involved here: UGameUserSettings, the UGameViewportClient, FSlateApplication, the GEngine->GameViewport, and I’m not quite sure where to look.

Any help is appreciated. And I will post here if I discover a solution.

@Devolution.exe I might have found a solution to the problem. The full discussion is in the thread I mentioned. The “fix” is adding these lines to <project>/Config/DefaultEngine.ini:

[ConsoleVariables]
Slate.Transform.FullscreenMouseInput=False

The real fix is probably to fill a bug report to the engine team.

1 Like