summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/input')
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index f3cc160b3e..2ab66efe59 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -49,6 +49,9 @@
#include <QtCore/private/qcore_unix_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qguiapplication_p.h>
+
+#include <mutex>
+
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
@@ -560,8 +563,9 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
if (!m_contacts.isEmpty() && m_contacts.constBegin().value().trackingId == -1)
assignIds();
+ std::unique_lock<QMutex> locker;
if (m_filtered)
- m_mutex.lock();
+ locker = std::unique_lock<QMutex>{m_mutex};
// update timestamps
m_lastTimeStamp = m_timeStamp;
@@ -648,9 +652,6 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
if (!m_touchPoints.isEmpty() && combinedStates != Qt::TouchPointStationary)
reportPoints();
-
- if (m_filtered)
- m_mutex.unlock();
}
m_lastEventType = data->type;