diff options
| author | Szybet <53944559+Szybet@users.noreply.github.com> | 2025-09-30 17:08:03 +0200 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-10-02 10:27:09 +0300 |
| commit | 03c564736ae96de01de1aecd9e941ab112ea2af8 (patch) | |
| tree | 81f8ca0e5605efc4711c32ce330f6789cac12912 /src/input/mod.rs | |
| parent | 1b41ef146d7ae73a6686aeb2454af5965976b271 (diff) | |
| download | niri-03c564736ae96de01de1aecd9e941ab112ea2af8.tar.gz niri-03c564736ae96de01de1aecd9e941ab112ea2af8.tar.bz2 niri-03c564736ae96de01de1aecd9e941ab112ea2af8.zip | |
Support calibration-matrix in touch input config
Diffstat (limited to 'src/input/mod.rs')
| -rw-r--r-- | src/input/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
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), + ); } } |
