Changeset View
Changeset View
Standalone View
Standalone View
input.cpp
Show First 20 Lines • Show All 1094 Lines • ▼ Show 20 Line(s) | 1094 | if (input()->touch()->decorationPressId() == -1) { | |||
---|---|---|---|---|---|
1095 | return false; | 1095 | return false; | ||
1096 | } | 1096 | } | ||
1097 | if (input()->touch()->decorationPressId() != qint32(id)) { | 1097 | if (input()->touch()->decorationPressId() != qint32(id)) { | ||
1098 | // ignore, but filter out | 1098 | // ignore, but filter out | ||
1099 | return true; | 1099 | return true; | ||
1100 | } | 1100 | } | ||
1101 | m_lastGlobalTouchPos = pos; | 1101 | m_lastGlobalTouchPos = pos; | ||
1102 | m_lastLocalTouchPos = pos - decoration->client()->pos(); | 1102 | m_lastLocalTouchPos = pos - decoration->client()->pos(); | ||
1103 | if (auto c = workspace()->getMovingClient()) { | ||||
1104 | c->updateMoveResize(pos); | ||||
1105 | } else { | ||||
1103 | QHoverEvent e(QEvent::HoverMove, m_lastLocalTouchPos, m_lastLocalTouchPos); | 1106 | QHoverEvent e(QEvent::HoverMove, m_lastLocalTouchPos, m_lastLocalTouchPos); | ||
1104 | QCoreApplication::instance()->sendEvent(decoration->decoration(), &e); | 1107 | QCoreApplication::instance()->sendEvent(decoration->decoration(), &e); | ||
1105 | decoration->client()->processDecorationMove(m_lastLocalTouchPos.toPoint(), pos.toPoint()); | 1108 | decoration->client()->processDecorationMove(m_lastLocalTouchPos.toPoint(), pos.toPoint()); | ||
1109 | } | ||||
1106 | return true; | 1110 | return true; | ||
1107 | } | 1111 | } | ||
1108 | bool touchUp(quint32 id, quint32 time) override { | 1112 | bool touchUp(quint32 id, quint32 time) override { | ||
1109 | Q_UNUSED(time); | 1113 | Q_UNUSED(time); | ||
1110 | auto decoration = input()->touch()->decoration(); | 1114 | auto decoration = input()->touch()->decoration(); | ||
1111 | if (!decoration) { | 1115 | if (!decoration) { | ||
1112 | return false; | 1116 | return false; | ||
1113 | } | 1117 | } | ||
1114 | if (input()->touch()->decorationPressId() == -1) { | 1118 | if (input()->touch()->decorationPressId() == -1) { | ||
1115 | return false; | 1119 | return false; | ||
1116 | } | 1120 | } | ||
1117 | if (input()->touch()->decorationPressId() != qint32(id)) { | 1121 | if (input()->touch()->decorationPressId() != qint32(id)) { | ||
1118 | // ignore, but filter out | 1122 | // ignore, but filter out | ||
1119 | return true; | 1123 | return true; | ||
1120 | } | 1124 | } | ||
1121 | // send mouse up | 1125 | // send mouse up | ||
1126 | if (auto c = workspace()->getMovingClient()) { | ||||
1127 | c->endMoveResize(); | ||||
1128 | } else { | ||||
1122 | QMouseEvent e(QEvent::MouseButtonRelease, m_lastLocalTouchPos, m_lastGlobalTouchPos, Qt::LeftButton, Qt::MouseButtons(), input()->keyboardModifiers()); | 1129 | QMouseEvent e(QEvent::MouseButtonRelease, m_lastLocalTouchPos, m_lastGlobalTouchPos, Qt::LeftButton, Qt::MouseButtons(), input()->keyboardModifiers()); | ||
1123 | e.setAccepted(false); | 1130 | e.setAccepted(false); | ||
1124 | QCoreApplication::sendEvent(decoration->decoration(), &e); | 1131 | QCoreApplication::sendEvent(decoration->decoration(), &e); | ||
1125 | decoration->client()->processDecorationButtonRelease(&e); | 1132 | decoration->client()->processDecorationButtonRelease(&e); | ||
1133 | } | ||||
1126 | 1134 | | |||
1127 | m_lastGlobalTouchPos = QPointF(); | 1135 | m_lastGlobalTouchPos = QPointF(); | ||
1128 | m_lastLocalTouchPos = QPointF(); | 1136 | m_lastLocalTouchPos = QPointF(); | ||
1129 | input()->touch()->setDecorationPressId(-1); | 1137 | input()->touch()->setDecorationPressId(-1); | ||
1130 | return true; | 1138 | return true; | ||
1131 | } | 1139 | } | ||
1132 | private: | 1140 | private: | ||
1133 | QPointF m_lastGlobalTouchPos; | 1141 | QPointF m_lastGlobalTouchPos; | ||
▲ Show 20 Lines • Show All 1080 Lines • Show Last 20 Lines |