Commit 31b13af3 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

input: don't forward gestures used by KWin to applications

If both compositor and applications were to use these gestures at the same
time, that would be quite confusing for the user. This also works around
a bug in Wine that makes applications crash.

BUG: 455952


(cherry picked from commit 34344c8d)
parent 957ff80a
Pipeline #209835 passed with stage
in 29 minutes and 35 seconds
......@@ -1011,52 +1011,84 @@ public:
bool swipeGestureBegin(int fingerCount, quint32 time) override
{
Q_UNUSED(time)
input()->shortcuts()->processSwipeStart(DeviceType::Touchpad, fingerCount);
return false;
m_touchpadGestureFingerCount = fingerCount;
if (m_touchpadGestureFingerCount >= 3) {
input()->shortcuts()->processSwipeStart(DeviceType::Touchpad, fingerCount);
return true;
} else {
return false;
}
}
bool swipeGestureUpdate(const QSizeF &delta, quint32 time) override
{
Q_UNUSED(time)
input()->shortcuts()->processSwipeUpdate(DeviceType::Touchpad, delta);
return false;
if (m_touchpadGestureFingerCount >= 3) {
input()->shortcuts()->processSwipeUpdate(DeviceType::Touchpad, delta);
return true;
} else {
return false;
}
}
bool swipeGestureCancelled(quint32 time) override
{
Q_UNUSED(time)
input()->shortcuts()->processSwipeCancel(DeviceType::Touchpad);
return false;
if (m_touchpadGestureFingerCount >= 3) {
input()->shortcuts()->processSwipeCancel(DeviceType::Touchpad);
return true;
} else {
return false;
}
}
bool swipeGestureEnd(quint32 time) override
{
Q_UNUSED(time)
input()->shortcuts()->processSwipeEnd(DeviceType::Touchpad);
return false;
if (m_touchpadGestureFingerCount >= 3) {
input()->shortcuts()->processSwipeEnd(DeviceType::Touchpad);
return true;
} else {
return false;
}
}
bool pinchGestureBegin(int fingerCount, quint32 time) override
{
Q_UNUSED(time);
if (fingerCount >= 3) {
m_touchpadGestureFingerCount = fingerCount;
if (m_touchpadGestureFingerCount >= 3) {
input()->shortcuts()->processPinchStart(fingerCount);
return true;
} else {
return false;
}
return false;
}
bool pinchGestureUpdate(qreal scale, qreal angleDelta, const QSizeF &delta, quint32 time) override
{
Q_UNUSED(time);
input()->shortcuts()->processPinchUpdate(scale, angleDelta, delta);
return false;
if (m_touchpadGestureFingerCount >= 3) {
input()->shortcuts()->processPinchUpdate(scale, angleDelta, delta);
return true;
} else {
return false;
}
}
bool pinchGestureEnd(quint32 time) override
{
Q_UNUSED(time);
input()->shortcuts()->processPinchEnd();
return false;
if (m_touchpadGestureFingerCount >= 3) {
input()->shortcuts()->processPinchEnd();
return true;
} else {
return false;
}
}
bool pinchGestureCancelled(quint32 time) override
{
Q_UNUSED(time);
input()->shortcuts()->processPinchCancel();
return false;
if (m_touchpadGestureFingerCount >= 3) {
input()->shortcuts()->processPinchCancel();
return true;
} else {
return false;
}
}
bool touchDown(qint32 id, const QPointF &pos, quint32 time) override
{
......@@ -1165,6 +1197,7 @@ private:
uint32_t m_lastTouchDownTime = 0;
QPointF m_lastAverageDistance;
QMap<int32_t, QPointF> m_touchPoints;
int m_touchpadGestureFingerCount = 0;
QTimer *m_powerDown = nullptr;
};
......
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