From 25035229b73742f9e6a96ac3e535b30b5c6196a8 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Fri, 19 Feb 2021 23:16:56 -0800 Subject: [PATCH] xquartz: Don't process AppKit events if we haven't finished initializing Signed-off-by: Jeremy Huddleston Sequoia --- hw/xquartz/X11Application.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index af1ea5839..8b9b1f104 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -200,6 +200,14 @@ QuartzModeBundleInit(void); - (void) sendEvent:(NSEvent *)e { + /* Don't try sending to X if we haven't initialized. This can happen if AppKit takes over + * (eg: uncaught exception) early in launch. + */ + if (!eventTranslationQueue) { + [super sendEvent:e]; + return; + } + OSX_BOOL for_appkit, for_x; OSX_BOOL const x_active = self.x_active;