diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-01 03:02:23 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-01 03:02:23 +0200 |
commit | 186ccec24e0974dea7cd72badf404f53816092e0 (patch) | |
tree | 171e74aa4a982b2793b10295870740ccfd3e777c | |
parent | 58e6781645230f1dc672138776bfe1bc467129f4 (diff) | |
parent | 91ed3e7c5800a6ef4bea9d0c4d80196f94caec95 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Iab50e5a4af2e2adc4dd40575b7039dadb6d514b5
16 files changed, 161 insertions, 1 deletions
diff --git a/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.pro b/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.pro index 53f7af8aa..c89ecec00 100644 --- a/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.pro +++ b/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.pro @@ -5,6 +5,8 @@ OTHER_FILES += brcm-egl.json SOURCES += \ main.cpp +TARGET = qt-wayland-compositor-brcm-egl + include(../../../../hardwareintegration/compositor/brcm-egl/brcm-egl.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pro b/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pro index 1601a384c..5771d5705 100644 --- a/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pro +++ b/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pro @@ -5,6 +5,8 @@ OTHER_FILES += dmabuf-server.json SOURCES += \ main.cpp +TARGET = qt-wayland-compositor-dmabuf-server-buffer + include($PWD/../../../../../hardwareintegration/compositor/dmabuf-server/dmabuf-server.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pro b/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pro index 040031122..aeaa54c49 100644 --- a/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pro +++ b/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pro @@ -5,6 +5,8 @@ OTHER_FILES += drm-egl-server.json SOURCES += \ main.cpp +TARGET = qt-wayland-compositor-drm-egl-server-buffer + include($PWD/../../../../../hardwareintegration/compositor/drm-egl-server/drm-egl-server.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/src/plugins/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2.pro b/src/plugins/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2.pro index ff16b20bf..1c21f04e4 100644 --- a/src/plugins/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2.pro +++ b/src/plugins/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2.pro @@ -7,6 +7,8 @@ OTHER_FILES += vsp2.json SOURCES += \ main.cpp +TARGET = qt-wayland-compositor-vsp2 + include($PWD/../../../../../../hardwareintegration/compositor/hardwarelayer/vsp2/vsp2.pri) PLUGIN_TYPE = wayland-hardware-layer-integration diff --git a/src/plugins/hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pro b/src/plugins/hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pro index 9e28c7e8c..84dc6e017 100644 --- a/src/plugins/hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pro +++ b/src/plugins/hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pro @@ -5,6 +5,8 @@ OTHER_FILES += libhybris-egl-server.json SOURCES += \ main.cpp +TARGET = qt-wayland-compositor-libybris-egl-server.json + include($PWD/../../../../../hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/src/plugins/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pro b/src/plugins/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pro index bc4311423..1f76f9f00 100644 --- a/src/plugins/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pro +++ b/src/plugins/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pro @@ -5,6 +5,8 @@ OTHER_FILES += linux-dmabuf.json SOURCES += \ main.cpp \ +TARGET = qt-wayland-compositor-linux-dmabuf-unstable-v1 + include(../../../../hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/src/plugins/hardwareintegration/compositor/shm-emulation-server/shm-emulation-server.pro b/src/plugins/hardwareintegration/compositor/shm-emulation-server/shm-emulation-server.pro index 56a1bac21..67026e475 100644 --- a/src/plugins/hardwareintegration/compositor/shm-emulation-server/shm-emulation-server.pro +++ b/src/plugins/hardwareintegration/compositor/shm-emulation-server/shm-emulation-server.pro @@ -5,6 +5,8 @@ OTHER_FILES += shm-emulation-server.json SOURCES += \ main.cpp +TARGET = qt-wayland-compositor-shm-emulation-server + include($PWD/../../../../../hardwareintegration/compositor/shm-emulation-server/shm-emulation-server.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.pro b/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.pro index 053654218..28d3a5852 100644 --- a/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.pro +++ b/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.pro @@ -5,6 +5,8 @@ OTHER_FILES += vulkan-server.json SOURCES += \ main.cpp +TARGET = qt-wayland-compositor-vulkan-server + include($PWD/../../../../../hardwareintegration/compositor/vulkan-server/vulkan-server.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro b/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro index 6aecefffd..d452220c5 100644 --- a/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro +++ b/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro @@ -5,7 +5,7 @@ OTHER_FILES += wayland-egl.json SOURCES += \ main.cpp -TARGET = qt-plugin-wayland-egl +TARGET = qt-wayland-compositor-wayland-egl include(../../../../hardwareintegration/compositor/wayland-egl/wayland-egl.pri) diff --git a/src/plugins/hardwareintegration/compositor/wayland-eglstream-controller/wayland-eglstream-controller.pro b/src/plugins/hardwareintegration/compositor/wayland-eglstream-controller/wayland-eglstream-controller.pro index f1ca7183a..6d259a687 100644 --- a/src/plugins/hardwareintegration/compositor/wayland-eglstream-controller/wayland-eglstream-controller.pro +++ b/src/plugins/hardwareintegration/compositor/wayland-eglstream-controller/wayland-eglstream-controller.pro @@ -5,6 +5,8 @@ OTHER_FILES += wayland-eglstream-controller.json SOURCES += \ main.cpp \ +TARGET = qt-wayland-compositor-wayland-eglstream-controller + include(../../../../hardwareintegration/compositor/wayland-eglstream-controller/wayland-eglstream-controller.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pro b/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pro index 7c391bd1c..298ed2fc6 100644 --- a/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pro +++ b/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pro @@ -5,6 +5,8 @@ OTHER_FILES += xcomposite-egl.json SOURCES += \ main.cpp +TARGET = qt-wayland-compositor-xcomposite-egl + include(../../../../hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pro b/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pro index 0f49471da..41e5c2ec5 100644 --- a/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pro +++ b/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pro @@ -5,6 +5,8 @@ OTHER_FILES += xcomposite-glx.json SOURCES += \ main.cpp +TARGET = qt-wayland-compositor-xcomposite-glx + include(../../../../hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pri) PLUGIN_TYPE = wayland-graphics-integration-server diff --git a/tests/auto/client/seatv4/BLACKLIST b/tests/auto/client/seatv4/BLACKLIST new file mode 100644 index 000000000..1c761a74e --- /dev/null +++ b/tests/auto/client/seatv4/BLACKLIST @@ -0,0 +1,2 @@ +[animatedCursor] +b2qt diff --git a/tests/auto/client/seatv5/tst_seatv5.cpp b/tests/auto/client/seatv5/tst_seatv5.cpp index ae7c3db2f..636f26081 100644 --- a/tests/auto/client/seatv5/tst_seatv5.cpp +++ b/tests/auto/client/seatv5/tst_seatv5.cpp @@ -69,6 +69,8 @@ private slots: void createsTouch(); void singleTap(); void singleTapFloat(); + void multiTouch(); + void multiTouchUpAndMotionFrame(); }; void tst_seatv5::bindsToSeat() @@ -463,5 +465,126 @@ void tst_seatv5::singleTapFloat() } } +void tst_seatv5::multiTouch() +{ + TouchWindow window; + QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial); + + exec([=] { + auto *t = touch(); + auto *c = client(); + + t->sendDown(xdgToplevel()->surface(), {32, 32}, 0); + t->sendDown(xdgToplevel()->surface(), {48, 48}, 1); + t->sendFrame(c); + + // Compositor event order should not change the order of the QTouchEvent::touchPoints() + // See QTBUG-77014 + t->sendMotion(c, {49, 48}, 1); + t->sendMotion(c, {33, 32}, 0); + t->sendFrame(c); + + t->sendUp(c, 0); + t->sendFrame(c); + + t->sendUp(c, 1); + t->sendFrame(c); + }); + + QTRY_VERIFY(!window.m_events.empty()); + { + auto e = window.m_events.takeFirst(); + QCOMPARE(e.type, QEvent::TouchBegin); + QCOMPARE(e.touchPointStates, Qt::TouchPointState::TouchPointPressed); + QCOMPARE(e.touchPoints.length(), 2); + + QCOMPARE(e.touchPoints[0].state(), Qt::TouchPointState::TouchPointPressed); + QCOMPARE(e.touchPoints[0].pos(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top())); + + QCOMPARE(e.touchPoints[1].state(), Qt::TouchPointState::TouchPointPressed); + QCOMPARE(e.touchPoints[1].pos(), QPointF(48-window.frameMargins().left(), 48-window.frameMargins().top())); + } + { + auto e = window.m_events.takeFirst(); + QCOMPARE(e.type, QEvent::TouchUpdate); + QCOMPARE(e.touchPoints.length(), 2); + + QCOMPARE(e.touchPoints[0].state(), Qt::TouchPointState::TouchPointMoved); + QCOMPARE(e.touchPoints[0].pos(), QPointF(33-window.frameMargins().left(), 32-window.frameMargins().top())); + + QCOMPARE(e.touchPoints[1].state(), Qt::TouchPointState::TouchPointMoved); + QCOMPARE(e.touchPoints[1].pos(), QPointF(49-window.frameMargins().left(), 48-window.frameMargins().top())); + } + { + auto e = window.m_events.takeFirst(); + QCOMPARE(e.type, QEvent::TouchUpdate); + QCOMPARE(e.touchPointStates, Qt::TouchPointState::TouchPointReleased | Qt::TouchPointState::TouchPointStationary); + QCOMPARE(e.touchPoints.length(), 2); + + QCOMPARE(e.touchPoints[0].state(), Qt::TouchPointState::TouchPointReleased); + QCOMPARE(e.touchPoints[0].pos(), QPointF(33-window.frameMargins().left(), 32-window.frameMargins().top())); + + QCOMPARE(e.touchPoints[1].state(), Qt::TouchPointState::TouchPointStationary); + QCOMPARE(e.touchPoints[1].pos(), QPointF(49-window.frameMargins().left(), 48-window.frameMargins().top())); + } + { + auto e = window.m_events.takeFirst(); + QCOMPARE(e.type, QEvent::TouchEnd); + QCOMPARE(e.touchPointStates, Qt::TouchPointState::TouchPointReleased); + QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints[0].state(), Qt::TouchPointState::TouchPointReleased); + QCOMPARE(e.touchPoints[0].pos(), QPointF(49-window.frameMargins().left(), 48-window.frameMargins().top())); + } +} + +void tst_seatv5::multiTouchUpAndMotionFrame() +{ + TouchWindow window; + QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial); + + exec([=] { + auto *t = touch(); + auto *c = client(); + + t->sendDown(xdgToplevel()->surface(), {32, 32}, 0); + t->sendDown(xdgToplevel()->surface(), {48, 48}, 1); + t->sendFrame(c); + + // Sending an up event after a frame event, before any motion or down events used to + // unnecessarily trigger a workaround for a bug in an old version of Weston. The workaround + // would prematurely insert a fake frame event splitting the touch event up into two events. + // However, this should only be needed on the up event for the very last touch point. So in + // this test we verify that it doesn't unncecessarily break up the events. + t->sendUp(c, 0); + t->sendMotion(c, {49, 48}, 1); + t->sendFrame(c); + + t->sendUp(c, 1); + t->sendFrame(c); + }); + + QTRY_VERIFY(!window.m_events.empty()); + { + auto e = window.m_events.takeFirst(); + QCOMPARE(e.type, QEvent::TouchBegin); + QCOMPARE(e.touchPoints[0].state(), Qt::TouchPointState::TouchPointPressed); + QCOMPARE(e.touchPoints[1].state(), Qt::TouchPointState::TouchPointPressed); + } + { + auto e = window.m_events.takeFirst(); + QCOMPARE(e.type, QEvent::TouchUpdate); + QCOMPARE(e.touchPoints.length(), 2); + QCOMPARE(e.touchPoints[0].state(), Qt::TouchPointState::TouchPointReleased); + QCOMPARE(e.touchPoints[1].state(), Qt::TouchPointState::TouchPointMoved); + } + { + auto e = window.m_events.takeFirst(); + QCOMPARE(e.type, QEvent::TouchEnd); + QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints[0].state(), Qt::TouchPointState::TouchPointReleased); + } + QVERIFY(window.m_events.empty()); +} + QCOMPOSITOR_TEST_MAIN(tst_seatv5) #include "tst_seatv5.moc" diff --git a/tests/auto/client/shared/coreprotocol.cpp b/tests/auto/client/shared/coreprotocol.cpp index 120c256c6..b0be2cb4e 100644 --- a/tests/auto/client/shared/coreprotocol.cpp +++ b/tests/auto/client/shared/coreprotocol.cpp @@ -424,6 +424,18 @@ uint Touch::sendUp(wl_client *client, int id) return serial; } +void Touch::sendMotion(wl_client *client, const QPointF &position, int id) +{ + wl_fixed_t x = wl_fixed_from_double(position.x()); + wl_fixed_t y = wl_fixed_from_double(position.y()); + + auto time = m_seat->m_compositor->currentTimeMilliseconds(); + + const auto touchResources = resourceMap().values(client); + for (auto *r : touchResources) + wl_touch::send_motion(r->handle, time, id, x, y); +} + void Touch::sendFrame(wl_client *client) { const auto touchResources = resourceMap().values(client); diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h index 50812c296..fe8202ad1 100644 --- a/tests/auto/client/shared/coreprotocol.h +++ b/tests/auto/client/shared/coreprotocol.h @@ -318,6 +318,7 @@ public: explicit Touch(Seat *seat) : m_seat(seat) {} uint sendDown(Surface *surface, const QPointF &position, int id); uint sendUp(wl_client *client, int id); + void sendMotion(wl_client *client, const QPointF &position, int id); void sendFrame(wl_client *client); Seat *m_seat = nullptr; |