[PATCH] winemac: Remove unused GetCurrentProcess() call.

Brendan Shanks bshanks at codeweavers.com
Tue Oct 6 20:25:56 CDT 2020


Yeah my guess is that Ken was originally trying to use a process-specific event tap (with CGEventTapCreateForPSN), then found that wouldn’t work (explained in comment at bottom) and used a session-wide tap instead, but forgot to remove the GetCurrentProcess() call to get the PSN.

> On Oct 6, 2020, at 5:01 PM, Chip Davis <cdavis at codeweavers.com> wrote:
> 
> I believe this call actually had (has?) a reason behind it. It's been there since ClipCursor() was implemented (cf. 9b0fdc64) Ken will know more; whether he's in a condition to share with us, I don't know.
> 
> October 6, 2020 6:49 PM, "Brendan Shanks" <bshanks at codeweavers.com> wrote:
> 
>> Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
>> ---
>> dlls/winemac.drv/cocoa_app.m | 24 ------------------------
>> 1 file changed, 24 deletions(-)
>> 
>> diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
>> index b4dcbfff473..e296d4b4af0 100644
>> --- a/dlls/winemac.drv/cocoa_app.m
>> +++ b/dlls/winemac.drv/cocoa_app.m
>> @@ -19,7 +19,6 @@
>> */
>> 
>> #import <Carbon/Carbon.h>
>> -#include <dlfcn.h>
>> 
>> #import "cocoa_app.h"
>> #import "cocoa_event.h"
>> @@ -1332,8 +1331,6 @@ CGEventRef WineAppEventTapCallBack(CGEventTapProxy proxy, CGEventType type,
>> 
>> - (BOOL) installEventTap
>> {
>> - ProcessSerialNumber psn;
>> - OSErr err;
>> CGEventMask mask = CGEventMaskBit(kCGEventLeftMouseDown) |
>> CGEventMaskBit(kCGEventLeftMouseUp) |
>> CGEventMaskBit(kCGEventRightMouseDown) |
>> @@ -1346,31 +1343,10 @@ - (BOOL) installEventTap
>> CGEventMaskBit(kCGEventOtherMouseDragged) |
>> CGEventMaskBit(kCGEventScrollWheel);
>> CFRunLoopSourceRef source;
>> - void* appServices;
>> - OSErr (*pGetCurrentProcess)(ProcessSerialNumber* PSN);
>> 
>> if (cursorClippingEventTap)
>> 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
>> // event tap because we need to programmatically move the cursor even when
>> // mouse moves are directed to other processes. We disable our tap when
>> -- 
>> 2.26.2
> 
> 
> Chip




More information about the wine-devel mailing list