-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backend
Description
Discussed in #3494
Originally posted by BernhardLThomas February 15, 2024
Hello, I've been playing around with winit and wgpu recently and I encountered an issue causing me to no longer receive WindowEvent::RedrawRequested events in the event loop.
Specifically this seems to happen as soon as I pass a reference to the Window to the Instance::create_surface method to create a surface.
I'm on MacOS with the current stable toolchain (1.76.0)
The following is a minimal example which causes the issue:
fn main() {
let event_loop = winit::event_loop::EventLoop::new().unwrap();
let window = winit::window::Window::new(&event_loop).unwrap();
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
..Default::default()
});
// this line causes the issue
let surface = instance.create_surface(window).unwrap();
event_loop.run(|event, elwt| match event {
winit::event::Event::WindowEvent { window_id, event } => match event {
winit::event::WindowEvent::CloseRequested => elwt.exit(),
winit::event::WindowEvent::Resized(size) => {
println!("resize: {:?}", size);
}
winit::event::WindowEvent::RedrawRequested => {
println!("redraw_requested");
}
_ => (),
},
_ => (),
});
}Originally posted by BernhardLThomas February 15, 2024
I should clarify, manually calling Window::request_redraw will still result in a WindowEvent::RedrawRequested. What I'm not receiving is redraw requests when resizing the window or similar.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backend