From d291345c137de2d3d253a4f90d130435a2018fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20R=C4=99bacz?= Date: Wed, 28 Jan 2026 09:35:05 +0100 Subject: [PATCH] CtrlCore: update mouse pos when receving DnD event on macOS. (#365) --- uppsrc/CtrlCore/CocoProc.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/uppsrc/CtrlCore/CocoProc.mm b/uppsrc/CtrlCore/CocoProc.mm index 00a075348..84d0ad282 100644 --- a/uppsrc/CtrlCore/CocoProc.mm +++ b/uppsrc/CtrlCore/CocoProc.mm @@ -287,7 +287,7 @@ struct MMImp { Upp::Ctrl::ReleaseCtrlCapture(); } - static int DnD(Upp::Ctrl *ctrl, id info, bool paste = false) + static int DnD(Upp::Ctrl *ctrl, id info, bool paste = false) { if(!ctrl) return false; @@ -300,7 +300,8 @@ struct MMImp { clip.action = info.draggingSourceOperationMask & NSDragOperationMove ? DND_MOVE : DND_COPY; NSPoint np = [nsview convertPoint:[info draggingLocation] fromView:nil]; - ctrl->DnD(Upp::Point(DPI(np.x), DPI(np.y)) + ctrl->GetScreenRect().TopLeft(), clip); + coco_mouse_pos = Upp::Point(DPI(np.x), DPI(np.y)) + ctrl->GetScreenRect().TopLeft(); + ctrl->DnD(coco_mouse_pos, clip); if(paste && clip.IsAccepted() && clip.GetAction() == DND_COPY) Ctrl::local_dnd_copy = true; return clip.IsAccepted() ? clip.GetAction() == DND_MOVE ? NSDragOperationMove