MouseCursor Below Drag&Drop Widget

Hi all :smiley:

Using the native Drag&Drop functionality, I’m having the case where most UI dragged shows on top of the cursor, thus hiding the cursor. With one it even seems only one widget element is partially hiding it (but the rest is properly behind).

I’ve tried to increase the ZOrder of the Cursor image, but has no effect (which makes sense because it’s not changed on the root cursor UI).

For the cursor I’m just using the UserInterfaceSettings setup (Project Settings). UE adds it to the viewport.

The DragDropOperation I create in NativeOnDragDetected for which I create a new widget and set that one to be the “DefaultDragVisual”:

CreateWidget<UUW_DraggableButton>(this, GetCopyClass());
a_OutOperation->DefaultDragVisual = dragOperationWidgetCopy;

It then natively gets added to the viewport in SObjectWidget::OnDragDetected

Any help would be greatly appreciated, missing my cursor! :smiley:
Am I missing the method to manipulate the ZOrder of these widgets?

1 Like

I have a similar problem.

The orange box with text is the Drag Visual and the green one is my cursor.

Obviously, UE puts the cursor between two elements of the drag visual widget.

Have you found any solution?

you should just be able to offset the widget, ie set the X translation to -200

Would you mind providing a more detailed explanation?
I can’t understand how the x offset or the translation affects this problem.

From other related posts, it seems that this problem is caused by Unreal redrawing the drag visual and the cursor at another layer (Not at the viewport level, because the drag visual can be dragged out of the viewport as shown below) and disrupt their ZOrder.

im not in editor right now but the drag visual is just a widget. so if the widget is drawn at X (the cursor) and you set the image to X-/+300 for example it show be drawn to the right

There must be some misunderstanding.

We are discussing the problem of incorrect z-order between widgets. It is not just moving the drag visual away from the cursor, these widgets are in the correct position.

ah so you want the visual overlapping the cursor?

so whats the actual issue, is it blocking input for example? or is it simply you want the cursor on top?

Yup, like the OP, I want the custom cursor to always be on top.

However, we’re facing the same problem.

Sometimes the cursor will be under the drag visual, and sometimes it will be between the two elements of the drag visual. It depends on the widget structure of the drag visual and the cursor.

Also, if I don’t use the custom software cursor, these problems are just gone.

The engine version is 5.3.

well i cant help you with the engine drag/drop visual because i did it differently which is to just add an icon to my custom cursor and show/hide it when i’m dragging. so basically a custom system which is easy to do if you’re already using a custom cursor so hope that helps.