diff options
author | Liang Qi <liang.qi@qt.io> | 2021-10-25 17:07:32 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-03-14 00:28:08 +0000 |
commit | b922234cadace0f388e4b2b5eeae35fcf85f92c0 (patch) | |
tree | f108ff1f10beaebbdf9deec977275713f784ce46 /src/gui/kernel/qpointingdevice.cpp | |
parent | a90a35b50498282c546a5c4ab3e097d7b6f33d78 (diff) |
gui: return first default device when seatName isNull
for QInputDevice::primaryKeyboard() and
QPointingDevice::primaryPointingDevice().
This also reverts ae9fefe3c89fd5720ccaad0687f125e32f7c3fe6.
Fixes: QTBUG-100790
Change-Id: Id02f277db25f823eb29e939e25801325df8e4076
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 9c6b986d967b42bea5faca0d9fa1000c7edb023e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui/kernel/qpointingdevice.cpp')
-rw-r--r-- | src/gui/kernel/qpointingdevice.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qpointingdevice.cpp b/src/gui/kernel/qpointingdevice.cpp index e2f17f821c..750be2b728 100644 --- a/src/gui/kernel/qpointingdevice.cpp +++ b/src/gui/kernel/qpointingdevice.cpp @@ -286,7 +286,7 @@ const QPointingDevice *QPointingDevice::primaryPointingDevice(const QString& sea const QPointingDevice *mouse = nullptr; const QPointingDevice *touchpad = nullptr; for (const QInputDevice *dev : v) { - if (dev->seatName() != seatName) + if (!seatName.isNull() && dev->seatName() != seatName) continue; if (dev->type() == QInputDevice::DeviceType::Mouse) { if (!mouse) |