summaryrefslogtreecommitdiff
path: root/tikzit/src/osx/DraggablePDFView.m
diff options
context:
space:
mode:
Diffstat (limited to 'tikzit/src/osx/DraggablePDFView.m')
-rw-r--r--tikzit/src/osx/DraggablePDFView.m18
1 files changed, 11 insertions, 7 deletions
diff --git a/tikzit/src/osx/DraggablePDFView.m b/tikzit/src/osx/DraggablePDFView.m
index ce57473..ce393c7 100644
--- a/tikzit/src/osx/DraggablePDFView.m
+++ b/tikzit/src/osx/DraggablePDFView.m
@@ -38,17 +38,21 @@
- (void)mouseDown:(NSEvent *)theEvent
{
- NSPasteboard *pboard;
-
NSRect pageBox = [[[self document] pageAtIndex:0] boundsForBox:kPDFDisplayBoxMediaBox];
NSRect pageRect= [self convertRect:pageBox fromPage:[[self document] pageAtIndex:0]];
- pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
- [pboard declareTypes:[NSArray arrayWithObject:NSPasteboardTypePDF] owner:self];
- [pboard setData:[[self document] dataRepresentation] forType:NSPasteboardTypePDF];
+ NSArray *fileList = [NSArray arrayWithObjects:[[[self document] documentURL] path], nil];
+ NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
+ [pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil];
+ [pboard setPropertyList:fileList forType:NSFilenamesPboardType];
- [self dragImage:[[NSImage alloc] initWithData:[[self document] dataRepresentation]] at:pageRect.origin offset:pageRect.size
- event:theEvent pasteboard:pboard source:self slideBack:YES];
+ [self dragImage:[[NSImage alloc] initWithData:[[self document] dataRepresentation]]
+ at:pageRect.origin
+ offset:pageRect.size
+ event:theEvent
+ pasteboard:pboard
+ source:self
+ slideBack:YES];
return;
}