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
Can no longer nest Application.MainLoop.Invoke
(since 1.8.2)
#2073
Comments
Application.MainLoop.Invoke
Application.MainLoop.Invoke
(since 1.8.2)
I think in terms of user stories we want to start with the following: I want to be able to launch modal dialogs from Currently launching a modal Window from Terminal.Gui/Terminal.Gui/Views/Menu.cs Lines 571 to 584 in 32e7b63
While in Terminal.Gui/Terminal.Gui/Views/Button.cs Lines 229 to 235 in 7b93f44
We should understand why they are behaving differently, which one is more correct and how we can adjust the current code to still have the good stable locking stuff added in #1994 but also allow for this user story. |
Sorry, I made confusion because I thought you wanted that the follow should work, but was only to demonstrate the behavior you have mention. The menu run action is the same as the original but since the idle handlers lock was fixed, running a action through the |
Yeah my post was a bit muddled, sorry about that. I created Issue when I had a repro but before I had traced it down to ContextMenu callback being the responsible. Good fix though! Thanks |
Describe the bug
This is a behavior change in 1.8.2 and not present in 1.7.2
If a view is launched via Invoke e.g.
Then any calls to Invoke that are triggered from the
startWindow
are blocking and never finish until the window is closed.While the issue is easiest to demonstrate by launching a window via Invoke I think the issue manifests in other ways too. For example I have a window where callbacks cannot be registered in 1.8.2 (blocks until window is closed) - see HicServices/RDMP#1448 .
I have looked hard and can't see any problematic Invokes in my code but I think it is definitely related to the new locking behavior
UPDATE: Ok I know why my code is getting this deadlock, it is because of the use of ContextMenu. If you update the demo code to launch the test window via a menu you get same problem:
When running on 1.8.2 the 'Click Me' button gets stuck at 'Cancel' and its callback to increment the counter never happens. So total only increases by 1 when you press it instead of 4. In 1.7.2 it works correctly
To Reproduce
I have created a minimum repro:
For csproj use:
Run program then change back to 1.7.2 package reference
Expected behavior
Not sure, I'm open to discussion
The text was updated successfully, but these errors were encountered: