aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-08-09 14:19:22 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-08-10 14:50:51 +0400
commitc50e22d415f09dd15e164cff06c76e95102f3cf6 (patch)
tree70e20e0dd207f5241474321a717d5d6a1bbddb03
parent396ab935859f4eb46b3cf7aa36e7b496b5898b72 (diff)
downloadniri-c50e22d415f09dd15e164cff06c76e95102f3cf6.tar.gz
niri-c50e22d415f09dd15e164cff06c76e95102f3cf6.tar.bz2
niri-c50e22d415f09dd15e164cff06c76e95102f3cf6.zip
Add comment about crash
-rw-r--r--src/input.rs1
-rw-r--r--src/tty.rs15
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);
diff --git a/src/tty.rs b/src/tty.rs
index 1f0b72c3..0c74ee66 100644
--- a/src/tty.rs
+++ b/src/tty.rs
@@ -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);