summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2021-02-19 23:16:56 -0800
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2021-02-20 21:04:25 -0800
commit25035229b73742f9e6a96ac3e535b30b5c6196a8 (patch)
tree233a48195f28825ab148306da596b65225c814d6
parent487286d47260782d331229af10df17711cbca1ea (diff)
xquartz: Don't process AppKit events if we haven't finished initializing
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r--hw/xquartz/X11Application.m8
1 files changed, 8 insertions, 0 deletions
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;