Commit 61efc4c2 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

input: don't fail touchscreen gestures with invalid physical size

parent 9957f8c8
......@@ -1075,8 +1075,12 @@ public:
}
m_lastTouchDownTime = time;
auto output = kwinApp()->platform()->outputAt(pos.toPoint());
float xfactor = output->physicalSize().width() / (float)output->geometry().width();
float yfactor = output->physicalSize().height() / (float)output->geometry().height();
auto physicalSize = output->physicalSize();
if (!physicalSize.isValid()) {
physicalSize = QSize(190, 100);
}
float xfactor = physicalSize.width() / (float)output->geometry().width();
float yfactor = physicalSize.height() / (float)output->geometry().height();
bool distanceMatch = std::any_of(m_touchPoints.constBegin(), m_touchPoints.constEnd(), [pos, xfactor, yfactor](const auto &point) {
QPointF p = pos - point;
return std::abs(xfactor * p.x()) + std::abs(yfactor * p.y()) < 50;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment