summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index 0497d210e5..eb693426d9 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -49,6 +49,7 @@
#include <QtGui/qpointingdevice.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qpointingdevice_p.h>
#include <mutex>
@@ -465,6 +466,11 @@ void QEvdevTouchScreenHandler::registerPointingDevice()
m_device = new QPointingDevice(d->hw_name, id++,
QInputDevice::DeviceType::TouchScreen, QPointingDevice::PointerType::Finger,
caps, 16, 0);
+
+ auto geom = d->screenGeometry();
+ if (!geom.isNull())
+ QPointingDevicePrivate::get(m_device)->setAvailableVirtualGeometry(geom);
+
QWindowSystemInterface::registerInputDevice(m_device);
}
@@ -583,8 +589,10 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
for (auto it = m_contacts.begin(), end = m_contacts.end(); it != end; /*erasing*/) {
Contact &contact(it.value());
- if (!contact.state)
+ if (!contact.state) {
+ ++it;
continue;
+ }
int key = m_typeB ? it.key() : contact.trackingId;
if (!m_typeB && m_lastContacts.contains(key)) {
@@ -635,12 +643,14 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
for (auto it = m_contacts.begin(), end = m_contacts.end(); it != end; /*erasing*/) {
Contact &contact(it.value());
- if (!contact.state)
+ if (!contact.state) {
+ ++it;
continue;
+ }
if (contact.state == QEventPoint::State::Released) {
if (m_typeB) {
- contact.state = QEventPoint::State::Stationary;
+ contact.state = QEventPoint::State::Unknown;
} else {
it = m_contacts.erase(it);
continue;