Skip to content

Commit

Permalink
Fix Cursor Display Incorrectly On Drag (dotnet#11853)
Browse files Browse the repository at this point in the history
Re-add condition to check drag image
  • Loading branch information
lonitra authored Aug 10, 2024
1 parent d7c8152 commit 3983d44
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public HRESULT GiveFeedback(DROPEFFECT dwEffect)

_peer.OnGiveFeedback(gfbEvent);

if (IsDropTargetWindowInCurrentThread() && !gfbEvent.Equals(_lastGiveFeedbackEventArgs))
if (IsDropTargetWindowInCurrentThread() && gfbEvent.DragImage is not null && !gfbEvent.Equals(_lastGiveFeedbackEventArgs))
{
_lastGiveFeedbackEventArgs = gfbEvent.Clone();
UpdateDragImage(_lastGiveFeedbackEventArgs, _dataObject, _lastHwndTarget);
Expand Down Expand Up @@ -106,7 +106,7 @@ public unsafe HRESULT DragEnterTarget(HWND hwndTarget)

public HRESULT DragLeaveTarget()
{
if (IsDropTargetWindowInCurrentThread())
if (IsDropTargetWindowInCurrentThread() && _lastGiveFeedbackEventArgs?.DragImage is not null)
{
DragDropHelper.DragLeave();
}
Expand Down

0 comments on commit 3983d44

Please sign in to comment.