Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple winforms event loop from AppContext #750

Closed
freakboy3742 opened this issue Oct 12, 2019 · 1 comment · Fixed by #2112
Closed

Decouple winforms event loop from AppContext #750

freakboy3742 opened this issue Oct 12, 2019 · 1 comment · Fixed by #2112
Labels
enhancement New features, or improvements to existing features. windows The issue relates to Microsoft Windows support.

Comments

@freakboy3742
Copy link
Member

freakboy3742 commented Oct 12, 2019

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.

@mhsmith
Copy link
Member

mhsmith commented Jul 22, 2022

the patch for #741 includes most of the code to do this (commented out with FIXMEs),

To make the event loop code easier to read, this unused code was removed in #1503.

@freakboy3742 freakboy3742 added the windows The issue relates to Microsoft Windows support. label Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants