[bug?] UMG Dragable Window Crash

When trying to create a dragable window identical to the one from [this post on the forums][1] in ue 4.7.6 it will cause [the editor to crash][2]. (Note: the project attached to the forum post works fine, the issue only occurs when you try to recreate it).

I narrowed down the cause of the crash to calling UserInterfaceWidget’s GetMousePositionInViewport in DragableWindowWidget’s OnMouseMove function override.

UserInteface is assigned during widget creation, see UserInterfaceWidget’s CreateWindow function.

Here is the code inside UserInterfaceWidget’s GetMousePositionInViewport

Geometry is assigned in UserInterfaceWidgets Event Graph with the Geometry Struct passed by Event Tick.

Here is an alternative version of DragableWindowWidget’s OnMouseMove function that I got to work without crashing.

Instead of having a helper function I made the Geometry variable public and performed the calculation in OnMouseMove.

Hello MrBushido,

I was unable to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. What version of the engine are you using?
  2. Have you tried using the “Get Mouse Position Scaled by DPI” to get the current mouse position?
  3. How exactly are you recreating this project (Are you copying and pasting the nodes)?
  1. Launcher binary 4.7.6 release on windows 8.1
  2. That could work, but the way this is set up captures/releases mouse input while dragging and using GetMousePos appears to only get the location before mouse capture occurs (i.e. stays at the location from before your click). And the capture is handy in my case since left click dragging is also how I orientate a 3rd person camera, so the capture/release prevents dragging a window also moving the player camera.
  3. I recreated it completely by hand (twice!). [Here’s a cut down version I made the second time around][1] to eliminate as many of the sources of the crash as possible.

I’ve narrowed it down even further and it seems that the cause of the crash is caused by passing a PointerEvent argument to another function (and then calling a function on it?).

This image is from UserInterfaceWidget’s OnMouseMove override. The green comment code gets the vector2d from the mouse event and then calls the function in the second image and works fine. The red comment passes the mouse event itself to the function in the 3rd image which I presume causes the crash when it tries to dereference it and call GetScreenSpacePosition.

Seems like its caused by passing a pointer event to another function while capturing mouse input. Made a simpler project that causes the same crash

Hello MrBushido,

Thank you for all of the information that was provided. I was able to reproduce this issue on our end. However, after further testing I was able to find out that this issue has been resolved internally. This solution will be available in a later release of the engine.

Make it a great day