mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-24 02:46:33 +11:00
parent
491bc891e8
commit
8f03fb7a34
1 changed files with 1 additions and 15 deletions
|
@ -6,14 +6,8 @@ fn main() {
|
||||||
let window1 = winit::Window::new(&events_loop).unwrap();
|
let window1 = winit::Window::new(&events_loop).unwrap();
|
||||||
let window2 = winit::Window::new(&events_loop).unwrap();
|
let window2 = winit::Window::new(&events_loop).unwrap();
|
||||||
let window3 = winit::Window::new(&events_loop).unwrap();
|
let window3 = winit::Window::new(&events_loop).unwrap();
|
||||||
let window4 = winit::Window::new(&events_loop).unwrap();
|
|
||||||
|
|
||||||
let window4_id = window4.id();
|
let mut num_windows = 3;
|
||||||
let mut window4_opt = Some(window4);
|
|
||||||
|
|
||||||
let mut num_windows = 4;
|
|
||||||
|
|
||||||
println!("Press any key on any window to drop the 4th window explicitly. (Testing impl Drop for Window)");
|
|
||||||
|
|
||||||
if cfg!(target_os = "linux") {
|
if cfg!(target_os = "linux") {
|
||||||
println!("Running this example under wayland may not display a window at all.\n\
|
println!("Running this example under wayland may not display a window at all.\n\
|
||||||
|
@ -30,8 +24,6 @@ fn main() {
|
||||||
println!("Window 2 has been closed")
|
println!("Window 2 has been closed")
|
||||||
} else if window_id == window3.id() {
|
} else if window_id == window3.id() {
|
||||||
println!("Window 3 has been closed");
|
println!("Window 3 has been closed");
|
||||||
} else if window_id == window4_id {
|
|
||||||
println!("Window 4 has been closed");
|
|
||||||
} else {
|
} else {
|
||||||
unreachable!()
|
unreachable!()
|
||||||
}
|
}
|
||||||
|
@ -41,12 +33,6 @@ fn main() {
|
||||||
return winit::ControlFlow::Break;
|
return winit::ControlFlow::Break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
winit::Event::WindowEvent { event: winit::WindowEvent::KeyboardInput{..}, .. } => {
|
|
||||||
println!("Dropping window 4 explicitly");
|
|
||||||
window4_opt = None;
|
|
||||||
},
|
|
||||||
|
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
winit::ControlFlow::Continue
|
winit::ControlFlow::Continue
|
||||||
|
|
Loading…
Add table
Reference in a new issue