From 6e57005b4a759b5038cfcf602c915ecb0ae1eef6 Mon Sep 17 00:00:00 2001 From: jerry Date: Fri, 30 Aug 2013 20:18:13 +0000 Subject: [PATCH] limited drag file feature only for mac 10.7 or above --- src/lib/platform/COSXDragSimulator.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/platform/COSXDragSimulator.m b/src/lib/platform/COSXDragSimulator.m index ffd67c48..867d4d69 100644 --- a/src/lib/platform/COSXDragSimulator.m +++ b/src/lib/platform/COSXDragSimulator.m @@ -24,6 +24,7 @@ COSXDragView* g_dragView = NULL; void runCocoaApp() { +#ifdef MAC_OS_X_VERSION_10_7 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSApplication* app = [[NSApplication alloc] init]; @@ -43,11 +44,13 @@ runCocoaApp() [app run]; [pool release]; +#endif } void fakeDragging(const char* str, int length, int cursorX, int cursorY) { +#ifdef MAC_OS_X_VERSION_10_7 dispatch_async(dispatch_get_main_queue(), ^{ NSRect screen = [[NSScreen mainScreen] frame]; NSLog ( @"mouseLocation: %d %d", cursorX, cursorY); @@ -55,6 +58,7 @@ fakeDragging(const char* str, int length, int cursorX, int cursorY) [g_dragWindow setFrame:rect display:YES]; [g_dragWindow makeKeyWindow]; }); +#endif } CFStringRef