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
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.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-224492 in the post.
0 |
Component | UE - Editor - UI Systems - UMG |
---|---|
Affects Versions | 5.4 |
Target Fix | 5.6 |
Created | Sep 17, 2024 |
---|---|
Updated | Oct 10, 2024 |