Summary
The macosx backend has an event_loop_is_running method, documented as:
Return whether the macosx backend has set up the NSApp main event loop.
The method name is wrong, at least from the macOS perspective. The event loop is not running until a call to plt.show() or FigureCanvas.start_event_loop.
The documentation string is partially incorrect - the state of the event loop after we call lazy_init() is an implementation detail of NSApplication and PyOS_InputHook. It could still be "not set up" until the first call to CFRunLoopGet…().
Proposed fix
The method should probably be is_backend_initialized or something similar with a documentation string of:
Return whether the macosx backend has been initialized.
That said, event_loop_is_running needs to remain a method as it is being directly called by vispy's _detect_eventloop.py
Perhaps we should expose our _get_running_interactive_framework() as documented public API so other projects do not need to access backend internals?
Summary
The macosx backend has an
event_loop_is_runningmethod, documented as:The method name is wrong, at least from the macOS perspective. The event loop is not running until a call to
plt.show()orFigureCanvas.start_event_loop.The documentation string is partially incorrect - the state of the event loop after we call
lazy_init()is an implementation detail of NSApplication and PyOS_InputHook. It could still be "not set up" until the first call toCFRunLoopGet…().Proposed fix
The method should probably be
is_backend_initializedor something similar with a documentation string of:That said,
event_loop_is_runningneeds to remain a method as it is being directly called by vispy's _detect_eventloop.pyPerhaps we should expose our
_get_running_interactive_framework()as documented public API so other projects do not need to access backend internals?