diff options
author | mmeof2 <manikmalhotra92@gmail.com> | 2015-08-01 19:26:40 +0400 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-08-15 21:55:47 +0000 |
commit | b3364c13ced09d903d7390febb36f35faf3baa86 (patch) | |
tree | a700126484f335c432194bc2f3cea0ff38a9d803 | |
parent | 92c3a5b80ac575e1c538894b7c1a4170093785b5 (diff) |
tdf#44621: Fixed drag and drop in OSX 10.7+
Change-Id: I8f9e1e9205dd9611f4bc1ef47c8cde2e284b403f
Reviewed-on: https://gerrit.libreoffice.org/17461
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r-- | vcl/osx/DropTarget.cxx | 20 | ||||
-rw-r--r-- | vcl/osx/DropTarget.hxx | 2 |
2 files changed, 16 insertions, 6 deletions
diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx index 7ee0f5b48e1e..8c91f8745228 100644 --- a/vcl/osx/DropTarget.cxx +++ b/vcl/osx/DropTarget.cxx @@ -104,7 +104,8 @@ namespace /* private */ -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender { - return mDropTarget->performDragOperation(sender); + (void) sender; + return mDropTarget->performDragOperation(); } -(void)concludeDragOperation:(id <NSDraggingInfo>)sender @@ -200,7 +201,10 @@ NSDragOperation DropTarget::draggingEntered(id sender) sal_Int8 currentAction = determineDropAction(mDragSourceSupportedActions, sender); NSRect bounds = [mView bounds]; - NSPoint dragLocation = [sender draggedImageLocation]; + NSPoint mouseLoc = [NSEvent mouseLocation]; + + id wnd = [mView window]; + NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil]; CocoaToVCL(dragLocation, bounds); @@ -238,7 +242,10 @@ NSDragOperation DropTarget::draggingUpdated(id sender) { sal_Int8 currentAction = determineDropAction(currentDragSourceActions, sender); NSRect bounds = [mView bounds]; - NSPoint dragLocation = [sender draggedImageLocation]; + NSPoint mouseLoc = [NSEvent mouseLocation]; + + id wnd = [mView window]; + NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil]; CocoaToVCL(dragLocation, bounds); @@ -287,7 +294,7 @@ BOOL DropTarget::prepareForDragOperation(id /*sender*/) return 1; } -BOOL DropTarget::performDragOperation(id sender) +BOOL DropTarget::performDragOperation() { bool bSuccess = false; @@ -301,7 +308,10 @@ BOOL DropTarget::performDragOperation(id sender) } NSRect bounds = [mView bounds]; - NSPoint dragLocation = [sender draggedImageLocation]; + NSPoint mouseLoc = [NSEvent mouseLocation]; + + id wnd = [mView window]; + NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil]; CocoaToVCL(dragLocation, bounds); diff --git a/vcl/osx/DropTarget.hxx b/vcl/osx/DropTarget.hxx index d67b647b7111..be0b3dac16a7 100644 --- a/vcl/osx/DropTarget.hxx +++ b/vcl/osx/DropTarget.hxx @@ -125,7 +125,7 @@ public: NSDragOperation draggingUpdated(id sender); void draggingExited(id sender); BOOL prepareForDragOperation(id sender); - BOOL performDragOperation(id sender); + BOOL performDragOperation(); void concludeDragOperation(id sender); /* If multiple actions are supported by the drag source and |