diff --git a/src/_macosx.m b/src/_macosx.m index fe93193eb053..77a04e38410a 100755 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -80,6 +80,9 @@ static int wait_for_stdin() { // continuously run an event loop until the stdin_received flag is set to exit while (!stdin_received && !stdin_sigint) { + // This loop is similar to the main event loop and flush_events which have + // Py_[BEGIN|END]_ALLOW_THREADS surrounding the loop. + // This should not be necessary here because PyOS_InputHook releases the GIL for us. while (true) { NSEvent *event = [NSApp nextEventMatchingMask: NSEventMaskAny untilDate: [NSDate distantPast] @@ -383,6 +386,9 @@ static CGFloat _get_device_scale(CGContextRef cr) // to process, breaking out of the loop when no events remain and // displaying the canvas if needed. NSEvent *event; + + Py_BEGIN_ALLOW_THREADS + while (true) { event = [NSApp nextEventMatchingMask: NSEventMaskAny untilDate: [NSDate distantPast] @@ -393,6 +399,9 @@ static CGFloat _get_device_scale(CGContextRef cr) } [NSApp sendEvent:event]; } + + Py_END_ALLOW_THREADS + [self->view displayIfNeeded]; Py_RETURN_NONE; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy