-
Notifications
You must be signed in to change notification settings - Fork 919
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
[Windows] Panic when opening dialog while using ControlFlow::WaitUntil #2291
Comments
Update: I've managed to fix this issue by applying the following patch to winit. --- a/src/platform_impl/windows/event_loop.rs
+++ b/src/platform_impl/windows/event_loop.rs
@@ -2262,7 +2262,9 @@ unsafe extern "system" fn thread_event_target_callback<T: 'static>(
}
}
}
- userdata.event_loop_runner.poll();
+ if !userdata.event_loop_runner.should_buffer() {
+ userdata.event_loop_runner.poll();
+ }
0
}
_ => winuser::DefWindowProcW(window, msg, wparam, lparam), |
Would really like to see some effort put into this one, this is causing random issues on some windows desktops when using iced. I applied the patch, which seems to fix it. |
@dtzxporter is this issue still a thing on the latest master or betas? We changed a lot around the loop control. |
I can try to test this, my issue is it's so random that it happens like 1 in every 1000 runs on my machine, but a user of my program has it happen consistently... This is the specific commit that iced is using at the moment (With iced patches) It's a bit behind, but I don't know when the changes happened. I can attempt to update iced's deps, but it's going to be a pain to coordinate with the user regardless to see if it's fixed. |
yeah, their winit is very behind. I'd suggest to wait for iced to update and then we could probably iterate on that, or maybe someone familiar with windows could look into. |
Is there a reason this issue was left open? It is stated to be fixed in iced-rs#14 and it seems fixed when a workaround for this issue is removed from Ruffle: |
I believe this is related to issues #1587, #1602, and #1611, that were all fixed by #1615.
This is essentially the same issue, except it only occurs while the event loop's control flow is set to
WaitUntil
. There is no panic when usingWait
orPoll
.I currently work around this issue by creating message boxes from a new thread.
Here is a minimal example reproducing the bug: https://gist.github.com/53648c963f91552e7039a266e0359004
The code will spawn a message box after around a second, then winit should panic in the following second. The panic may not always occur, so reproducing the issue might require running the example multiple times. Closing the message box fast enough will also prevent the panic from showing up.
As an additional note, I have only reproduced the issue when creating the message box while handling
MainEventsCleared
. The panic does not show up when creating the message box while handling aKeyboardInput
event. I have not tried creating message boxes while handling other events.Here is a stacktrace of the panic:
The text was updated successfully, but these errors were encountered: