From 03c564736ae96de01de1aecd9e941ab112ea2af8 Mon Sep 17 00:00:00 2001 From: Szybet <53944559+Szybet@users.noreply.github.com> Date: Tue, 30 Sep 2025 17:08:03 +0200 Subject: Support calibration-matrix in touch input config --- src/input/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/input/mod.rs') diff --git a/src/input/mod.rs b/src/input/mod.rs index ddd24c4a..163c7748 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -4564,6 +4564,20 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: } else { input::SendEventsMode::ENABLED }); + + #[rustfmt::skip] + const IDENTITY_MATRIX: [f32; 6] = [ + 1., 0., 0., + 0., 1., 0., + ]; + + let _ = device.config_calibration_set_matrix( + c.calibration_matrix + .as_deref() + .and_then(|m| m.try_into().ok()) + .or(device.config_calibration_default_matrix()) + .unwrap_or(IDENTITY_MATRIX), + ); } } -- cgit