[Libreoffice-commits] core.git: vcl/osx

mmeof2 manikmalhotra92 at gmail.com
Sun May 10 12:42:50 PDT 2015


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

New commits:
commit cfdd89f10fdc15b36bd0d1023e49ca3752feb51e
Author: mmeof2 <manikmalhotra92 at gmail.com>
Date:   Sat May 9 18:05:11 2015 +0530

    tdf#44621: Fixed drag and drop in OSX 10.7+
    
    Change-Id: Iefcc529d8ffa608e26c75a445341e0b8ae11c613
    Reviewed-on: https://gerrit.libreoffice.org/15683
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index b52e433..13190ff 100644
--- a/vcl/osx/DropTarget.cxx
+++ b/vcl/osx/DropTarget.cxx
@@ -105,7 +105,8 @@ namespace /* private */
 
 -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
 {
-    return mDropTarget->performDragOperation(sender);
+    (void) sender;
+    return mDropTarget->performDragOperation();
 }
 
 -(void)concludeDragOperation:(id <NSDraggingInfo>)sender
@@ -201,7 +202,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);
 
@@ -239,7 +243,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);
 
@@ -288,7 +295,7 @@ BOOL DropTarget::prepareForDragOperation()
     return 1;
 }
 
-BOOL DropTarget::performDragOperation(id sender)
+BOOL DropTarget::performDragOperation()
 {
     bool bSuccess = false;
 
@@ -302,7 +309,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 09f4ee8..d31f506 100644
--- a/vcl/osx/DropTarget.hxx
+++ b/vcl/osx/DropTarget.hxx
@@ -125,7 +125,7 @@ public:
   NSDragOperation draggingUpdated(id sender);
   void draggingExited(id sender);
   static BOOL prepareForDragOperation();
-  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