-
Notifications
You must be signed in to change notification settings - Fork 568
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
Panic with file open dialog and ExtEventSink #1041
Comments
The underlying issue is that druid-shell doesn't like to be called re-entrantly. There's a quick fix (which I'll try to write tomorrow), in which we use But I also think it's worth discussing (and documenting!) in more detail:
|
I'm pretty sure some of the file dialog code takes mutable borrows needlessly when regular borrows would work. I have something like that in my notes. Not sure if this is strictly related to this specific crash here. I skimmed the code but during the minutes I spent I couldn't really grasp where the initial More generally I'm not sure that file dialogs should be blocking at all. This seems to cause a ton of issues with very minor gains. |
The original borrow is taken for druid-shell to call I had some thoughts about avoiding blocking calls to create dialogs, but I had given up on them as being too complex. Let me open up another issue to discuss the problem. |
* Don't panic in the GTK idle handler if already borrowed. Fixes #1041.
If another thread sends a command with an
ExtEventSink
while the file open dialog is open, Druid panics. It comes from therun_idle
function inwindow.rs
trying to mutably borrow theWindowState
handler. I'm guessing that this is because the handler is already borrowed while blocking on the file open dialog.I'm on Arch Linux with the GTK backend, but I have no easy way to test Windows or Mac.
Here is a minimal example:
Click the button as soon as the window opens, then wait for the thread to sumbit the command.
The output:
The text was updated successfully, but these errors were encountered: