diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-09 14:19:22 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-10 14:50:51 +0400 |
| commit | c50e22d415f09dd15e164cff06c76e95102f3cf6 (patch) | |
| tree | 70e20e0dd207f5241474321a717d5d6a1bbddb03 | |
| parent | 396ab935859f4eb46b3cf7aa36e7b496b5898b72 (diff) | |
| download | niri-c50e22d415f09dd15e164cff06c76e95102f3cf6.tar.gz niri-c50e22d415f09dd15e164cff06c76e95102f3cf6.tar.bz2 niri-c50e22d415f09dd15e164cff06c76e95102f3cf6.zip | |
Add comment about crash
| -rw-r--r-- | src/input.rs | 1 | ||||
| -rw-r--r-- | src/tty.rs | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/input.rs b/src/input.rs index 9d167a0a..ad182645 100644 --- a/src/input.rs +++ b/src/input.rs @@ -120,6 +120,7 @@ impl Niri { InputEvent::PointerAxis { event, .. } => { let source = event.source(); + // FIXME: this crashes on keyboard scroll. let horizontal_amount = event .amount(Axis::Horizontal) .unwrap_or_else(|| event.amount_discrete(Axis::Horizontal).unwrap() * 3.0); @@ -115,6 +115,8 @@ impl Tty { match event { SessionEvent::PauseSession => { + debug!("pausing session"); + libinput.suspend(); if let Some(output_device) = &tty.output_device { @@ -122,14 +124,19 @@ impl Tty { } } SessionEvent::ActivateSession => { + debug!("resuming session"); + if libinput.resume().is_err() { error!("error resuming libinput"); } - if let Some(output_device) = &tty.output_device { - // FIXME: according to Catacomb, resetting DRM+Compositor is preferrable - // here, but currently not possible due to a bug somewhere. - tty.device_changed(output_device.id, niri); + if let Some(output_device) = &mut tty.output_device { + output_device.drm.activate(); + + if let Err(err) = output_device.drm_compositor.surface().reset_state() { + warn!("error resetting DRM surface state: {err}"); + } + output_device.drm_compositor.reset_buffers(); } niri.redraw(tty); |
