diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-10 09:58:26 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-10 14:50:51 +0400 |
| commit | 9b073b2350d00dfdb32a4983a102c4bde843c92c (patch) | |
| tree | 4144883e824f80f4ffa1aa1509128a6371ffab4e /src/winit.rs | |
| parent | ed6132645a4cb5eefafe39333bc7d8d8abd2acf6 (diff) | |
| download | niri-9b073b2350d00dfdb32a4983a102c4bde843c92c.tar.gz niri-9b073b2350d00dfdb32a4983a102c4bde843c92c.tar.bz2 niri-9b073b2350d00dfdb32a4983a102c4bde843c92c.zip | |
Redraw on demand rather than continuously
Diffstat (limited to 'src/winit.rs')
| -rw-r--r-- | src/winit.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/winit.rs b/src/winit.rs index 51d86c20..458ff95a 100644 --- a/src/winit.rs +++ b/src/winit.rs @@ -115,16 +115,17 @@ impl Winit { ); } WinitEvent::Input(event) => niri.process_input_event(&mut |_| (), event), - _ => (), + WinitEvent::Focus(_) => (), + WinitEvent::Refresh => niri.queue_redraw(), }); - if let Err(WinitError::WindowClosed) = res { - niri.stop_signal.stop(); - return; - } else { - res.unwrap(); + // I want this to stop compiling if more errors are added. + #[allow(clippy::single_match)] + match res { + Err(WinitError::WindowClosed) => { + niri.stop_signal.stop(); + } + Ok(()) => (), } - - niri.redraw(self); } } |
