Skip to content

Commit

Permalink
kde-plasma/kscreen: Only modify Coordinate Transformation Matrix
Browse files Browse the repository at this point in the history
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=474110

Signed-off-by: Andreas Sturmlechner <[email protected]>
  • Loading branch information
a17r committed Sep 24, 2023
1 parent 88dcc5a commit beb5670
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
From 49dbf9b9fb021d63ef5b712460483e6fe8c23a1c Mon Sep 17 00:00:00 2001
From: theofficial gman <[email protected]>
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<Atom, XDeleter> 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

55 changes: 55 additions & 0 deletions kde-plasma/kscreen/kscreen-5.27.8-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

ECM_TEST="forceoptional"
KFMIN=5.106.0
PVCUT=$(ver_cut 1-3)
QTMIN=5.15.9
inherit ecm plasma.kde.org

DESCRIPTION="KDE Plasma screen management"
HOMEPAGE="https://invent.kde.org/plasma/kscreen"

LICENSE="GPL-2" # TODO: CHECK
SLOT="5"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
IUSE=""

# bug #580440, last checked 5.6.3
RESTRICT="test"

DEPEND="
>=dev-qt/qtdbus-${QTMIN}:5
>=dev-qt/qtdeclarative-${QTMIN}:5[widgets]
>=dev-qt/qtgui-${QTMIN}:5
>=dev-qt/qtsensors-${QTMIN}:5
>=dev-qt/qtwidgets-${QTMIN}:5
>=dev-qt/qtx11extras-${QTMIN}:5
>=kde-frameworks/kcmutils-${KFMIN}:5
>=kde-frameworks/kconfig-${KFMIN}:5
>=kde-frameworks/kcoreaddons-${KFMIN}:5
>=kde-frameworks/kdeclarative-${KFMIN}:5
>=kde-frameworks/kdbusaddons-${KFMIN}:5
>=kde-frameworks/kglobalaccel-${KFMIN}:5
>=kde-frameworks/ki18n-${KFMIN}:5
>=kde-frameworks/kwindowsystem-${KFMIN}:5
>=kde-frameworks/kxmlgui-${KFMIN}:5
>=kde-frameworks/plasma-${KFMIN}:5
>=kde-plasma/layer-shell-qt-${PVCUT}:5
>=kde-plasma/libkscreen-${PVCUT}:5=
x11-libs/libX11
x11-libs/libxcb:=
x11-libs/libXi
"
RDEPEND="${DEPEND}
>=dev-qt/qtgraphicaleffects-${QTMIN}:5
>=kde-plasma/kde-cli-tools-${PVCUT}:5
"
BDEPEND=">=kde-frameworks/kcmutils-${KFMIN}:5"

PATCHES=(
"${FILESDIR}/${P}-cmake.patch" # bug 914142
"${FILESDIR}/${P}-libinput-calibration-matrix.patch" # KDE-bug 474110
)

0 comments on commit beb5670

Please sign in to comment.