From 9d186a4dd5c0f8a22ff06e8382cd925c24201e13 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Mon, 4 Nov 2019 14:21:18 +0100 Subject: [PATCH 1/3] Fix touch being ignored when down and motion are in the same frame The Wayland protocol gives no guarantees about which events are part of a frame, so handle the case where we receive wl_touch.down and wl_touch.motion within the same frame. Fixes: QTBUG-79744 Change-Id: I5dd9302576d81da38e003c8e7e74da6a98def603 Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 8f3df8e4dda..193ce714b8b 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -1062,7 +1062,10 @@ void QWaylandInputDevice::handleTouchPoint(int id, Qt::TouchPointState state, co tp.area.moveCenter(globalPosition); } - tp.state = state; + // If the touch point was pressed earlier this frame, we don't want to overwrite its state. + if (tp.state != Qt::TouchPointPressed) + tp.state = state; + tp.pressure = tp.state == Qt::TouchPointReleased ? 0 : 1; } From bf1336af6a2f260d9c198356eb2ff0abfcb55c8b Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 7 Nov 2019 09:56:55 +0100 Subject: [PATCH 2/3] Fix race condition in tests on xdg_toplevel configure Tests should not use non-direct connections, as that means tests can run when the compositor is not locked. Change-Id: I7b1f0e3bb866db540f72307ad96f778ec0edd7ee Reviewed-by: Paul Olav Tvete --- tests/auto/wayland/shared/mockcompositor.cpp | 11 ++++------- tests/auto/wayland/shared/xdgshell.cpp | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/auto/wayland/shared/mockcompositor.cpp b/tests/auto/wayland/shared/mockcompositor.cpp index 6b9af4295b8..0711c5d8e56 100644 --- a/tests/auto/wayland/shared/mockcompositor.cpp +++ b/tests/auto/wayland/shared/mockcompositor.cpp @@ -58,13 +58,10 @@ DefaultCompositor::DefaultCompositor() }); }); - QObject::connect(get(), &XdgWmBase::toplevelCreated, [&] (XdgToplevel *toplevel) { - // Needed because lambdas don't support Qt::DirectConnection - exec([&]{ - if (m_config.autoConfigure) - toplevel->sendCompleteConfigure(); - }); - }); + QObject::connect(get(), &XdgWmBase::toplevelCreated, get(), [&] (XdgToplevel *toplevel) { + if (m_config.autoConfigure) + toplevel->sendCompleteConfigure(); + }, Qt::DirectConnection); } Q_ASSERT(isClean()); } diff --git a/tests/auto/wayland/shared/xdgshell.cpp b/tests/auto/wayland/shared/xdgshell.cpp index 13acc01e219..72582f48d7f 100644 --- a/tests/auto/wayland/shared/xdgshell.cpp +++ b/tests/auto/wayland/shared/xdgshell.cpp @@ -83,7 +83,7 @@ XdgSurface::XdgSurface(XdgWmBase *xdgWmBase, Surface *surface, wl_client *client { QVERIFY(!surface->m_pending.buffer); QVERIFY(!surface->m_committed.buffer); - connect(this, &XdgSurface::toplevelCreated, xdgWmBase, &XdgWmBase::toplevelCreated); + connect(this, &XdgSurface::toplevelCreated, xdgWmBase, &XdgWmBase::toplevelCreated, Qt::DirectConnection); connect(surface, &Surface::attach, this, &XdgSurface::verifyConfigured); connect(surface, &Surface::commit, this, [this] { m_committed = m_pending; From 857cbf07791cee60c79e2288e2c3c6357eb17ffe Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 15 Nov 2019 15:42:40 +0100 Subject: [PATCH 3/3] Fix spelling of linuxaccessibility_support-private Fixes issues with the cmake conversion tool. Task-number: QTBUG-78177 Change-Id: I49edbcba7494d1916cf6bf976148c9433615d8a0 Reviewed-by: Alexandru Croitor --- src/plugins/platforms/wayland/client.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/client.pro b/src/plugins/platforms/wayland/client.pro index d0ae9009e94..32156470cba 100644 --- a/src/plugins/platforms/wayland/client.pro +++ b/src/plugins/platforms/wayland/client.pro @@ -19,8 +19,8 @@ qtConfig(xkbcommon) { QT_FOR_PRIVATE += xkbcommon_support-private } -qtHaveModule(linuxaccessibility_support_private): \ - QT_PRIVATE += linuxaccessibility_support_private +qtHaveModule(linuxaccessibility_support-private): \ + QT_PRIVATE += linuxaccessibility_support-private QMAKE_USE += wayland-client