Decouple winforms event loop from AppContext #750
Labels
enhancement
New features, or improvements to existing features.
windows
The issue relates to Microsoft Windows support.
PR #741 added a Winforms compatible Proactor, enabling asyncio event handling for Windows.
However, this proactor is currently bound to the lifecycle of the AppContext, which means that asyncio only works if there is a "main window" registered with the app. This is fine for simple apps; but managing which app is the "main" window (especially if there are multiple such candidates) will be problematic in the long term.
It is possible to decouple this by using an application-level message filter to inject the tick event; the patch for #741 includes most of the code to do this (commented out with FIXMEs), but we can't use this code yet because of a bug in Python.net
Once that bug is resolved, we should move to a decoupled asycnio event loop. This will also involve auditing the way an application closes when the last window (or main window) is closed.
The text was updated successfully, but these errors were encountered: