-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix panic in application.rs example when entering fullscreen #4173
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
base: master
Are you sure you want to change the base?
Conversation
aloucks
commented
Mar 20, 2025
- Tested on all platforms changed
| let size = self.window.surface_size(); | ||
| if let (Some(width), Some(height)) = | ||
| (NonZeroU32::new(size.width), NonZeroU32::new(size.height)) | ||
| { | ||
| self.surface.resize(width, height)?; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a bug in some other place? The resize must be handled inside the resize, and if the window changes the size in draw but resize event is not delivered at this point, this means that the Resize should be done from within whatever triggered the draw?
Also, which platform resulted in this being required?
|
It panics on MacOS when indexing the buffer. There's no resize event logged before the panic. Line 993 in 7e13248
|
|
I added some extra debug I think you're right. This seems like a bug in winit and not in the example |
|
The winit/src/platform_impl/apple/appkit/window_delegate.rs Lines 175 to 180 in 7e13248
The @madsmtm You left the note here that I think the issue comes down to the "source of truth" for the surface size (or any of these attributes). The value reported by Windows Windows also seems to fire two surface events. One that looks closer to the old value, but possibly including the window decorations? MacOS |
That's exactly the reason I've asked when it happens, since the size desync shouldn't happen. |
b2317b1 to
e00689d
Compare