[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - vcl/osx

mmeof2 manikmalhotra92 at gmail.com
Sat Aug 15 14:56:08 PDT 2015


 vcl/osx/DropTarget.cxx |   20 +++++++++++++++-----
 vcl/osx/DropTarget.hxx |    2 +-
 2 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit b3364c13ced09d903d7390febb36f35faf3baa86
Author: mmeof2 <manikmalhotra92 at gmail.com>
Date:   Sat Aug 1 19:26:40 2015 +0400

    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 at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index 7ee0f5b..8c91f87 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 d67b647..be0b3da 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


More information about the Libreoffice-commits mailing list