From ca0c1533e318398b6714eb92a6c8086d89e19ae6 Mon Sep 17 00:00:00 2001 From: Stuart Carnie Date: Wed, 17 Oct 2018 22:39:45 -0700 Subject: [PATCH] fix(cocoa): Suppress event propagation when event is not for RA window This is required when the Qt window is focused. Ideally, event handling should be reviewed and refactored such that this hack is not necessary. --- ui/drivers/ui_cocoa.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index f454831e90..b248d5ae9e 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -121,11 +121,18 @@ static void app_terminate(void) - (void)sendEvent:(NSEvent *)event { - NSEventType event_type; - cocoa_input_data_t *apple = NULL; [super sendEvent:event]; + + RetroArch_OSX *delegate = (RetroArch_OSX *)self.delegate; + if (event.window != delegate.window) { + // TODO(sgc): this is just a hack for the 1.7.5 release to + // ignore RA processing events that are not for the RA window. + // Ideally, we'de delegate `sendEvent` to the window listener + return; + } - event_type = event.type; + cocoa_input_data_t *apple = NULL; + NSEventType event_type = event.type; switch (event_type) {