diff --git a/src/lib/platform/COSXDragSimulator.m b/src/lib/platform/COSXDragSimulator.m index 867d4d69..c1dbb2d7 100644 --- a/src/lib/platform/COSXDragSimulator.m +++ b/src/lib/platform/COSXDragSimulator.m @@ -18,13 +18,14 @@ #import #import +#if defined(MAC_OS_X_VERSION_10_7) + NSWindow* g_dragWindow = NULL; COSXDragView* g_dragView = NULL; void runCocoaApp() { -#ifdef MAC_OS_X_VERSION_10_7 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSApplication* app = [[NSApplication alloc] init]; @@ -44,13 +45,11 @@ 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); @@ -58,7 +57,6 @@ fakeDragging(const char* str, int length, int cursorX, int cursorY) [g_dragWindow setFrame:rect display:YES]; [g_dragWindow makeKeyWindow]; }); -#endif } CFStringRef @@ -66,3 +64,5 @@ getCocoaDropTarget() { return [g_dragView getDropTarget]; } + +#endif diff --git a/src/lib/platform/COSXDragView.h b/src/lib/platform/COSXDragView.h index bf58fcf6..5c2438d2 100644 --- a/src/lib/platform/COSXDragView.h +++ b/src/lib/platform/COSXDragView.h @@ -17,6 +17,8 @@ #import +#ifdef MAC_OS_X_VERSION_10_7 + @interface COSXDragView : NSView { NSMutableString* m_dropTarget; @@ -26,3 +28,5 @@ -(void)clearDropTarget; @end + +#endif diff --git a/src/lib/platform/COSXScreen.cpp b/src/lib/platform/COSXScreen.cpp index ecbe22bd..a58d9256 100644 --- a/src/lib/platform/COSXScreen.cpp +++ b/src/lib/platform/COSXScreen.cpp @@ -604,6 +604,7 @@ COSXScreen::fakeMouseButton(ButtonID id, bool press) void COSXScreen::getDropTargetThread(void*) { +#if defined(MAC_OS_X_VERSION_10_7) char* cstr = NULL; // wait for 5 secs for the drop destinaiton string to be filled. @@ -628,6 +629,9 @@ COSXScreen::getDropTargetThread(void*) LOG((CLOG_ERR "failed to get drop target")); m_dropTarget.clear(); } +#else + LOG((CLOG_WARN "drag drop not supported")); +#endif delete m_getDropTargetThread; } @@ -736,9 +740,13 @@ COSXScreen::showCursor() m_cursorHidden = false; if (m_fakeDraggingStarted) { +#if defined(MAC_OS_X_VERSION_10_7) // TODO: use real file extension fakeDragging("txt", 3, m_xCursor, m_yCursor); fakeMouseButton(kButtonLeft, true); +#else + LOG((CLOG_WARN "drag drop not supported")); +#endif } } diff --git a/src/lib/synergy/CClientApp.cpp b/src/lib/synergy/CClientApp.cpp index 80b1764d..0bee70f9 100644 --- a/src/lib/synergy/CClientApp.cpp +++ b/src/lib/synergy/CClientApp.cpp @@ -536,7 +536,7 @@ CClientApp::mainLoop() // that. DAEMON_RUNNING(true); -#if defined(__APPLE__) +#if defined(MAC_OS_X_VERSION_10_7) CThread thread( new TMethodJob( this, &CClientApp::runEventsLoop, diff --git a/src/lib/synergy/CServerApp.cpp b/src/lib/synergy/CServerApp.cpp index d886fb4a..d20502be 100644 --- a/src/lib/synergy/CServerApp.cpp +++ b/src/lib/synergy/CServerApp.cpp @@ -787,11 +787,11 @@ CServerApp::mainLoop() // that. DAEMON_RUNNING(true); -#if defined(__APPLE__) +#if defined(MAC_OS_X_VERSION_10_7) CThread thread( - new TMethodJob( - this, &CServerApp::runEventsLoop, - NULL)); + new TMethodJob( + this, &CServerApp::runEventsLoop, + NULL)); runCocoaApp(); #else m_events->loop();