mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-24 22:02:44 -06:00
CtrlCore: update mouse pos when receving DnD event on macOS. (#365)
This commit is contained in:
parent
fcca1c08ad
commit
d291345c13
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue