CtrlCore: update mouse pos when receving DnD event on macOS. (#365)

This commit is contained in:
Zbigniew Rębacz 2026-01-28 09:35:05 +01:00 committed by GitHub
parent fcca1c08ad
commit d291345c13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -287,7 +287,7 @@ struct MMImp {
Upp::Ctrl::ReleaseCtrlCapture();
}
static int DnD(Upp::Ctrl *ctrl, id<NSDraggingInfo> info, bool paste = false)
static int DnD(Upp::Ctrl *ctrl, id<NSDraggingInfo> 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