Fix helper mouse button up event on drag drop end on Windows

Regression from 4efd411045
This commit is contained in:
Wojtek Figat
2022-11-30 18:06:39 +01:00
parent a3a001633b
commit 8694d9f9b4

View File

@@ -8,6 +8,7 @@
#include "Engine/Core/Collections/Array.h"
#include "Engine/Engine/Engine.h"
#include "Engine/Engine/Screen.h"
#include "Engine/Platform/IGuiData.h"
#include "Engine/Input/Input.h"
#include "Engine/Input/Mouse.h"
@@ -621,7 +622,11 @@ DragDropEffect WindowsWindow::DoDragDrop(const StringView& data)
// Fix hanging mouse state (Windows doesn't send WM_LBUTTONUP when we end the drag and drop)
if (Input::GetMouseButton(MouseButton::Left))
Input::Mouse->OnMouseUp(Input::Mouse->GetPosition(), MouseButton::Left, this);
{
::POINT point;
::GetCursorPos(&point);
Input::Mouse->OnMouseUp(Float2((float)point.x, (float)point.y), MouseButton::Left, this);
}
return SUCCEEDED(result) ? dropEffectFromOleEnum(dwEffect) : DragDropEffect::None;
}