Skip to content

Commit 303f7ff

Browse files
committed
macOS: small performance tweak
1 parent 893f80a commit 303f7ff

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

ui/drivers/ui_cocoa.m

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -319,19 +319,9 @@ static enum ui_msg_window_response ui_msg_window_cocoa_warning(ui_msg_window_sta
319319

320320
static void ui_application_cocoa_process_events(void)
321321
{
322-
for (;;)
323-
{
324-
NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
325-
if (!event)
326-
break;
327-
#ifndef HAVE_COCOA_METAL
328-
[event retain];
329-
#endif
330-
[NSApp sendEvent: event];
331-
#ifndef HAVE_COCOA_METAL
332-
[event retain];
333-
#endif
334-
}
322+
/* Intentionally empty. The CFRunLoopObserver (kCFRunLoopBeforeWaiting)
323+
* fires after the run loop has already processed pending events, so
324+
* manual event polling here is unnecessary and just adds overhead. */
335325
}
336326

337327
static ui_application_t ui_application_cocoa = {

0 commit comments

Comments
 (0)