-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backend
Description
Description
When the I exit the event loop, a tracing error is given.
Code that caused the error:
use winit::application::ApplicationHandler;
use winit::event::WindowEvent;
use winit::event_loop::{ActiveEventLoop, EventLoop};
use winit::window::{Window, WindowAttributes, WindowId};
fn main() {
tracing_subscriber::fmt::init();
let mut app = App {
window: None
};
let event_loop = EventLoop::new().unwrap();
event_loop.run_app(&mut app).unwrap();
}
struct App {
window: Option<Window>
}
impl ApplicationHandler for App {
fn resumed(&mut self, event_loop: &ActiveEventLoop) {
self.window = Some(event_loop.create_window(WindowAttributes::default()).unwrap());
}
fn window_event(&mut self, event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent) {
match event {
WindowEvent::CloseRequested => event_loop.exit(),
_ => ()
}
}
}The error:
2024-09-11T22:44:09.138281Z ERROR winit::platform_impl::macos::event_handler: tried to run event handler, but no handler was set
macOS version
ProductName: macOS
ProductVersion: 14.6.1
BuildVersion: 23G93Winit version
0.30.5
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