winemac: Remove unused GetCurrentProcess() call.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brendan Shanks 2020-10-06 15:52:18 -07:00 committed by Alexandre Julliard
parent 627d31fcd9
commit 863683342d
1 changed files with 0 additions and 24 deletions

View File

@ -19,7 +19,6 @@
*/ */
#import <Carbon/Carbon.h> #import <Carbon/Carbon.h>
#include <dlfcn.h>
#import "cocoa_app.h" #import "cocoa_app.h"
#import "cocoa_event.h" #import "cocoa_event.h"
@ -1332,8 +1331,6 @@ CGEventRef WineAppEventTapCallBack(CGEventTapProxy proxy, CGEventType type,
- (BOOL) installEventTap - (BOOL) installEventTap
{ {
ProcessSerialNumber psn;
OSErr err;
CGEventMask mask = CGEventMaskBit(kCGEventLeftMouseDown) | CGEventMask mask = CGEventMaskBit(kCGEventLeftMouseDown) |
CGEventMaskBit(kCGEventLeftMouseUp) | CGEventMaskBit(kCGEventLeftMouseUp) |
CGEventMaskBit(kCGEventRightMouseDown) | CGEventMaskBit(kCGEventRightMouseDown) |
@ -1346,31 +1343,10 @@ - (BOOL) installEventTap
CGEventMaskBit(kCGEventOtherMouseDragged) | CGEventMaskBit(kCGEventOtherMouseDragged) |
CGEventMaskBit(kCGEventScrollWheel); CGEventMaskBit(kCGEventScrollWheel);
CFRunLoopSourceRef source; CFRunLoopSourceRef source;
void* appServices;
OSErr (*pGetCurrentProcess)(ProcessSerialNumber* PSN);
if (cursorClippingEventTap) if (cursorClippingEventTap)
return TRUE; return TRUE;
// We need to get the Mac GetCurrentProcess() from the ApplicationServices
// framework with dlsym() because the Win32 function of the same name
// obscures it.
appServices = dlopen("/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices", RTLD_LAZY);
if (!appServices)
return FALSE;
pGetCurrentProcess = dlsym(appServices, "GetCurrentProcess");
if (!pGetCurrentProcess)
{
dlclose(appServices);
return FALSE;
}
err = pGetCurrentProcess(&psn);
dlclose(appServices);
if (err != noErr)
return FALSE;
// We create an annotated session event tap rather than a process-specific // We create an annotated session event tap rather than a process-specific
// event tap because we need to programmatically move the cursor even when // event tap because we need to programmatically move the cursor even when
// mouse moves are directed to other processes. We disable our tap when // mouse moves are directed to other processes. We disable our tap when