mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-10 21:56:13 +08:00
limited drag file feature only for mac 10.7 or above
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user