Add comment about crash
Browse files at this commitc50e22d415f09dd15e164cff06c76e95102f3cf6Parent: 396ab932 changed files +12 -4
- src/input.rs +1 -0
- src/tty.rs +11 -4
src/input.rsmodified+1 -0
| @@ -120,6 +120,7 @@ impl Niri { | |||
| 120 | InputEvent::PointerAxis { event, .. } => { | 120 | InputEvent::PointerAxis { event, .. } => { |
| 121 | let source = event.source(); | 121 | let source = event.source(); |
| 122 | 122 | ||
| 123 | + // FIXME: this crashes on keyboard scroll. | ||
| 123 | let horizontal_amount = event | 124 | let horizontal_amount = event |
| 124 | .amount(Axis::Horizontal) | 125 | .amount(Axis::Horizontal) |
| 125 | .unwrap_or_else(|| event.amount_discrete(Axis::Horizontal).unwrap() * 3.0); | 126 | .unwrap_or_else(|| event.amount_discrete(Axis::Horizontal).unwrap() * 3.0); |
src/tty.rsmodified+11 -4
| @@ -115,6 +115,8 @@ impl Tty { | |||
| 115 | 115 | ||
| 116 | match event { | 116 | match event { |
| 117 | SessionEvent::PauseSession => { | 117 | SessionEvent::PauseSession => { |
| 118 | + debug!("pausing session"); | ||
| 119 | + | ||
| 118 | libinput.suspend(); | 120 | libinput.suspend(); |
| 119 | 121 | ||
| 120 | if let Some(output_device) = &tty.output_device { | 122 | if let Some(output_device) = &tty.output_device { |
| @@ -122,14 +124,19 @@ impl Tty { | |||
| 122 | } | 124 | } |
| 123 | } | 125 | } |
| 124 | SessionEvent::ActivateSession => { | 126 | SessionEvent::ActivateSession => { |
| 127 | + debug!("resuming session"); | ||
| 128 | + | ||
| 125 | if libinput.resume().is_err() { | 129 | if libinput.resume().is_err() { |
| 126 | error!("error resuming libinput"); | 130 | error!("error resuming libinput"); |
| 127 | } | 131 | } |
| 128 | 132 | ||
| 129 | - if let Some(output_device) = &tty.output_device { | 133 | + if let Some(output_device) = &mut tty.output_device { |
| 130 | - // FIXME: according to Catacomb, resetting DRM+Compositor is preferrable | 134 | + output_device.drm.activate(); |
| 131 | - // here, but currently not possible due to a bug somewhere. | 135 | + |
| 132 | - tty.device_changed(output_device.id, niri); | 136 | + if let Err(err) = output_device.drm_compositor.surface().reset_state() { |
| 137 | + warn!("error resetting DRM surface state: {err}"); | ||
| 138 | + } | ||
| 139 | + output_device.drm_compositor.reset_buffers(); | ||
| 133 | } | 140 | } |
| 134 | 141 | ||
| 135 | niri.redraw(tty); | 142 | niri.redraw(tty); |