From 9be36b0755e7c69c9b1188d8e9168e285f66648a Mon Sep 17 00:00:00 2001 From: IoI_xD Date: Thu, 5 Mar 2026 20:19:19 -0700 Subject: [PATCH] mac: have key events get sent to parent --- src/backend/cocoa.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/backend/cocoa.m b/src/backend/cocoa.m index 7c566a8b0..d9add8e3b 100644 --- a/src/backend/cocoa.m +++ b/src/backend/cocoa.m @@ -247,7 +247,9 @@ static CGPoint pointFlip(CGPoint point) { int i; NSEvent *ev; - [self eventProcess:lastEvent]; + if (lastEvent) { + [self eventProcess:lastEvent]; + } while ((ev = [self->window nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] @@ -262,6 +264,8 @@ static CGPoint pointFlip(CGPoint point) { NSWindow *parentWindow = [self parentWindow]; MwLL h; MwBool doSendEvent = MwTRUE; + MwLL this = self->handle.pointer; + if (!win) { return; } @@ -789,10 +793,10 @@ static CGPoint pointFlip(CGPoint point) { } switch (ev.type) { case NSEventTypeKeyDown: - MwLLDispatch(h, key, &ch); + MwLLDispatch(this, key, &ch); break; case NSEventTypeKeyUp: - MwLLDispatch(h, key_released, &ch); + MwLLDispatch(this, key_released, &ch); break; default: break;