MCPcopy Create free account
hub / github.com/StrataWM/strata / winit_dispatch

Function winit_dispatch

src/backends/winit.rs:132–153  ·  view source on GitHub ↗
(winit: &mut WinitEventLoop, state: &mut StrataState, output: &Output)

Source from the content-addressed store, hash-verified

130}
131
132pub fn winit_dispatch(winit: &mut WinitEventLoop, state: &mut StrataState, output: &Output) {
133 // process winit events
134 let res = winit.dispatch_new_events(|event| {
135 match event {
136 WinitEvent::Resized { size, .. } => {
137 output.change_current_state(Some(Mode { size, refresh: 60_000 }), None, None, None);
138 }
139 WinitEvent::Input(event) => {
140 if let Err(e) = state.process_input_event(event) {
141 panic!("{:#?}", e);
142 }
143 }
144 _ => (),
145 }
146 });
147
148 if let PumpStatus::Exit(_) = res {
149 state.comp.borrow().loop_signal.stop();
150 } else {
151 state.comp.borrow_mut().winit_update();
152 }
153}

Callers 1

init_winitFunction · 0.85

Calls 2

process_input_eventMethod · 0.80
winit_updateMethod · 0.80

Tested by

no test coverage detected