mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Reimplement ui_application_cocoa_process_event
This commit is contained in:
parent
fb6642192d
commit
a8beb91f0f
@ -31,18 +31,22 @@ static void* ui_application_cocoa_initialize(void)
|
||||
|
||||
static void ui_application_cocoa_process_events(void)
|
||||
{
|
||||
SEL sel_nextEventMatchingMask_untilDate_inMode_dequeue =
|
||||
sel_registerName("nextEventMatchingMask:untilDate:inMode:dequeue:");
|
||||
Class class_NSDate = objc_getClass("NSDate");
|
||||
SEL sel_distantPast = sel_registerName("distantPast");
|
||||
SEL sel_sendEvent = sel_registerName("sendEvent:");
|
||||
id distant_past = ((id (*)(Class, SEL))objc_msgSend)(class_NSDate, sel_distantPast);
|
||||
for (;;)
|
||||
{
|
||||
NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
|
||||
if (!event)
|
||||
id event = ((id (*)(id, SEL, NSUInteger, id, id, BOOL))objc_msgSend)(NSApp, sel_nextEventMatchingMask_untilDate_inMode_dequeue,
|
||||
NSUIntegerMax,
|
||||
distant_past,
|
||||
NSDefaultRunLoopMode,
|
||||
YES);
|
||||
if (event == nil)
|
||||
break;
|
||||
#ifndef HAVE_COCOA_METAL
|
||||
[event retain];
|
||||
#endif
|
||||
[NSApp sendEvent: event];
|
||||
#ifndef HAVE_COCOA_METAL
|
||||
[event retain];
|
||||
#endif
|
||||
((id (*)(id, SEL, id))objc_msgSend)(NSApp, sel_sendEvent, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user