From 141eb39d8268f766ae0d1f27378e59725e42f526 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Wed, 7 Feb 2024 15:17:02 -0600 Subject: [PATCH] Allow threads during macos event loop --- src/_macosx.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/_macosx.m b/src/_macosx.m index 8038b72899df..299fed1785a8 100755 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -461,6 +461,8 @@ int mpl_check_modifier( return NULL; } + Py_BEGIN_ALLOW_THREADS + NSDate* date = (timeout > 0.0) ? [NSDate dateWithTimeIntervalSinceNow: timeout] : [NSDate distantFuture]; @@ -473,6 +475,8 @@ int mpl_check_modifier( [NSApp sendEvent: event]; } + Py_END_ALLOW_THREADS + Py_RETURN_NONE; }