summaryrefslogtreecommitdiff
path: root/vcl/osx
diff options
context:
space:
mode:
authormmeof2 <manikmalhotra92@gmail.com>2015-05-09 18:05:11 +0530
committerCaolán McNamara <caolanm@redhat.com>2015-05-10 19:42:31 +0000
commitcfdd89f10fdc15b36bd0d1023e49ca3752feb51e (patch)
tree16237ec0aa0f95447a1029eba433bee38d82fd05 /vcl/osx
parent8908f10fe3b6566db469a1f2bd2674d8d0425165 (diff)
tdf#44621: Fixed drag and drop in OSX 10.7+
Change-Id: Iefcc529d8ffa608e26c75a445341e0b8ae11c613 Reviewed-on: https://gerrit.libreoffice.org/15683 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/osx')
-rw-r--r--vcl/osx/DropTarget.cxx20
-rw-r--r--vcl/osx/DropTarget.hxx2
2 files changed, 16 insertions, 6 deletions
diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index b52e433f6db1..13190ff1ed86 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 09f4ee898218..d31f5069b30a 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