From 49dbf9b9fb021d63ef5b712460483e6fe8c23a1c Mon Sep 17 00:00:00 2001 From: theofficial gman Date: Sun, 24 Sep 2023 11:59:21 +0000 Subject: [PATCH] Only modify `Coordinate Transformation Matrix` Allow `libinput Calibration Matrix` to exist as whatever it has set to by default. This allows for a UDEV rule to be made to set the calibration matrix in cases where the display and touchscreen do not have the same orientation or pixel sizing. This now matches the mutter implementation. BUG: 474110 If my authorship is unsuitable (no real name used), I give permission for you to pick and reauthor at your wish. (cherry picked from commit c8f33c8fa3b194c883443457801119016cbbfe9f) --- kded/daemon.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/kded/daemon.cpp b/kded/daemon.cpp index f7cadee2..63ddf51a 100644 --- a/kded/daemon.cpp +++ b/kded/daemon.cpp @@ -483,7 +483,6 @@ void KScreenDaemon::alignX11TouchScreen() if (matrixAtom == 0) { return; } - auto calibrationMatrixAtom = getAtom(connection, "libinput Calibration Matrix"); auto floatAtom = getAtom(connection, "FLOAT"); if (floatAtom == 0) { return; @@ -532,23 +531,17 @@ void KScreenDaemon::alignX11TouchScreen() std::unique_ptr properties(XIListProperties(display, info->id, &nProperties)); bool matrixAtomFound = false; - bool libInputCalibrationAtomFound = false; Atom *atom = properties.get(); Atom *atomEnd = properties.get() + nProperties; for (; atom != atomEnd; atom++) { if (!internalOutputRect.isEmpty() && *atom == matrixAtom) { matrixAtomFound = true; - } else if (!internalOutputRect.isEmpty() && *atom == calibrationMatrixAtom) { - libInputCalibrationAtomFound = true; } } - if (libInputCalibrationAtomFound) { - setMatrixAtom(info, calibrationMatrixAtom, transform); - } if (matrixAtomFound) { - setMatrixAtom(info, matrixAtom, libInputCalibrationAtomFound ? QTransform() : transform); + setMatrixAtom(info, matrixAtom, transform); } // For now we assume there is only one touchscreen -- GitLab