-
Notifications
You must be signed in to change notification settings - Fork 815
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
Key events should not be sent to an inactive screen #4704
Comments
So, your example is "press a key twice and crash with 'TypeError: object NoneType...`on the self.dismiss()? To clarify, you can remove all the The issue is using |
Yeah, the example is actually Will's edit :) Sorry, this issue is kind of confusing and without context, as it was a quick note I made for Will based on something we discussed last week. The issue is that key events get sent to non-active screens for a short period, before the screen has been completely dismissed. Most people won't expect this and may be doing things in their code which assumes the screen is active - leading to crashes. |
The claimed sequence is:
So, something more like:
Then on a mouse move or timer, dismiss the window and pop it back, while pounding the keyboard and we should eventually hit "error"? |
The original issue was a deadlock which tripped deadlock detection. That no longer occurs, because we removed the deadlock detection after improving the way widgets are removed. However the deadlock remains in the above code. Essentially, the call to There is some other behavior that might need explaining, because it confused me initially. When you press a key on |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Key events get sent to non-active screens for a short period on calling
dismiss
, before the screen has been completely dismissed. Most people won't expect this and may be doing things in their code which assumes the screen is active - leading to crashes.We should ensure key events are only delivered to the screen while it remains active.
Edit:
The text was updated successfully, but these errors were encountered: