Description

When specifying a widget of a different size than the screen in FReply::LockMouseToWidget, the cursor is locked to a different position in native full screen mode.

It appears that the window size needs to be taken into account when calculating DisplayDistortion in the FSlateUser::LockCursorInternal function.

Workaround:

void FSlateUser::LockCursorInternal(const FWidgetPath& WidgetPath)
{
	//...
		// Screen space mapping scales everything. When viewport resolution doesn't match platform resolution, 
		// this causes offset cursor hit-tests in fullscreen. Correct when capturing mouse as viewport widget may be smaller than screen in pixels.
		if (FSlateApplication::Get().GetTransformFullscreenMouseInput() && !GIsEditor && NativeWindow->GetWindowMode() == EWindowMode::Fullscreen)
		{
			//...
#if 0
			FVector2f DisplayDistortion = SlateClipRect.GetSize() / DisplaySize;
#else
			TSharedPtr<SWindow> Window = FSlateApplication::Get().FindWidgetWindow(WidgetPath.GetLastWidget());
			FVector2f WindowSize = Window->GetSizeInScreen();
			FVector2f DisplayDistortion = WindowSize / DisplaySize;
#endif

 

Steps to Reproduce
  1. Open the attached repro project
  2. Play in Standalone
  3. Enter console command "r.FullScreenMode 0"
  4. Press [F11] key
  5. Move the mouse cursor to the top of the scroll box

Result:

Cursor locks into scroll box but display disappears and list scrolls up.

A cursor appears in the lower right corner of the viewport when right-clicked.

Expected:

The cursor is locked in the scroll box and the list scrolls up.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-224492 in the post.

0
Login to Vote

Unresolved
ComponentUE - Editor - UI Systems - UMG
Affects Versions5.4
Target Fix5.6
CreatedSep 17, 2024
UpdatedOct 10, 2024
View Jira Issue