-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
fj-app crashes when minimizing window #1424
Comments
Thank you for opening this issue, @kazatsuyu! I can't reproduce this issue on Linux/Wayland, but it's not surprising to see these kinds of differences in behavior between platforms. I can look into it at some point, but it would probably be more effective if someone who can test this directly would handle it. Adding https://github.com/hannobraun/Fornjot/labels/help%20wanted for that reason. |
I found an issue at gfx-rs/wgpu which appears to be the same. I'm also on Linux/Wayland so can't help with testing it. It looks like using |
I tried using First error:
New error:
Diff: diff --git a/crates/fj-window/src/event_loop_handler.rs b/crates/fj-window/src/event_loop_handler.rs
index 1e311d1d8..f17ade831 100644
--- a/crates/fj-window/src/event_loop_handler.rs
+++ b/crates/fj-window/src/event_loop_handler.rs
@@ -132,8 +132,8 @@ impl EventLoopHandler {
..
} => {
self.new_size = Some(ScreenSize {
- width: size.width,
- height: size.height,
+ width: size.width.max(1),
+ height: size.height.max(1),
});
}
Event::WindowEvent { |
Thanks for testing that out, @kazatsuyu! I was able to reproduce the new error on my system by hard-coding a minimal size:
I played with the dimensions, and discovered that the crash happens as soon as the width is smaller than the width of the So the reference to I found a related issue at emilk/egui, and the fix to that issue is in the One weird thing is that if I manually resize the window, I can get the width below |
Yes, thank you for testing, @kazatsuyu, and thank you for looking into this @zthompson47!
I like to track the latest dependency versions closely, and the new egui release also unblocks a bunch of other upgrades. Unless there is some truly difficult issue hindering the upgrade, I expect that to get done next week.
That makes sense, but I don't know enough about egui internals to add more than speculation of my own. I'm guessing that the difference is in the events emitted on the different platforms. Minimizing on Linux/Wayland produces one sequence of events that ends up working, minimizing on Windows produces another sequence of events that causes problems with egui. Maybe we should see what the egui upgrade next week brings. If that doesn't fix it, maybe we could compare the sequence of events produces on the different platforms ( |
I've just merged the upgrade to egui 0.20: #1444 I haven't checked whether that fixes the issue that @zthompson47 described. |
After the merge, hard-coding I suppose that means using |
Updating to bd2094b and using
Additionally, when the window was repeatedly minimized and restored, the following error occurred and caused a crash.
Although a large number of logs are generated during minimization, it is uncertain whether the warning is directly related to the crash. The newly occurring crash appears to be related to egui based on the log content. These issues may need to be addressed in separate issues. |
Thank you for reporting back, @zthompson47 and @kazatsuyu! I think, given the latest information from @kazatsuyu, it probably makes most sense to just stop rendering, if the size is zero. Something along the lines of
It never ends, does it 😄 Let's address the other problem first, since we have a better handle on that. If this second problem still occurs once the other one is fixed, then we can open a separate issue for that. |
This commit fixes hannobraun#1424
After stopping the rendering when the width or height of the window is 0, the crash and the warning disappeared, so I created a PR. |
This commit fixes hannobraun#1424
Version: fj-app 0.27.0 (development build; v0.27.0-39-g8c7dbc3b3)
OS: Windows 11 version 22H2 build 22621.819
It seems that this occurs when
width: 0, height: 0
is notified in the resize event and the screen buffer surface is updated with that value during minimization.For example, this kind of diff can avoid crashes.
However, even if the crash is avoided, there will be warnings:
So it might be better to have a mechanism to skip rendering during minimization.
The text was updated successfully, but these errors were encountered: