In PIE, FSlateApplication::OnMouseDown cause SButton::OnMouseButtonUp.
below is detail step :
- at PIE, faketouches environment.
- mouse down button A (touch/click method is Down and Up)
- mouse up button A
- mouse down button B, and not mouse up (touch/click method is Down and Up)
- you can find button B is clicked although not mouse up yet.
below is why it happens :
When button B is pressed down, you can find FSlateApplication::ProcessReply in call stack.
In that function, “LastWidgetsUnderCursor” is about button A (“WidgetsUnderCursorLastEvent” is added by “FSlateApplication::RoutePointerMoveEvent” when button A pressed down).
So any widget can skip “if(SomeWidgetPreviouslyUnderCursor != RequestedMouseCaptor)”.
So in for loop, finally “SomeWidgetPreviouslyUnderCursor->OnMouseLeave()” called when SomeWidgetPreviouslyUnderCursor is SEditorViewport.
After following call stack, you can find SButton::OnMouseButtonUp is called.
this is my solution :
I think that problem is WidgetsUnderCursorLastEvent always added regardless of dragging mode, but it removed only when dragging mode is true (In “FSlateApplication::RoutePointerUpEvent”, “WidgetsUnderCursorLastEvent.Remove” is called only bIsDragDropping is true).
So just move this line out of parenthesis for it always can called.
if you can find better solution, please tell me.
thanks.