summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2021-11-16 17:53:00 +0100
committerMarc Mutz <marc.mutz@qt.io>2021-11-16 17:13:16 +0000
commit550c867ead52c575b9d7117754d8c935916f0bb7 (patch)
tree09ecda7fe3a7ef7e7832535f16c146ec27803141 /tests
parent246f0c0bc01dd059bf8165e81f7b49efa36e4d95 (diff)
downloadqtwayland-550c867ead52c575b9d7117754d8c935916f0bb7.tar.gz
tst_seatv4: fix deprecated implicit capture of this by [=]
Since exec() is a synchronous call, we can just take everything by reference instead. Pick-to: 6.2 5.15 Change-Id: Ic1588db69ed6bb0d8dd39ff0439ad0fc97dd957f Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/client/seatv4/tst_seatv4.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/auto/client/seatv4/tst_seatv4.cpp b/tests/auto/client/seatv4/tst_seatv4.cpp
index b6394652..e23ed37d 100644
--- a/tests/auto/client/seatv4/tst_seatv4.cpp
+++ b/tests/auto/client/seatv4/tst_seatv4.cpp
@@ -135,19 +135,19 @@ void tst_seatv4::setsCursorOnEnter()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- exec([=] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
+ exec([&] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
}
void tst_seatv4::usesEnterSerial()
{
- QSignalSpy setCursorSpy(exec([=] { return pointer(); }), &Pointer::setCursor);
+ QSignalSpy setCursorSpy(exec([&] { return pointer(); }), &Pointer::setCursor);
QRasterWindow window;
window.resize(64, 64);
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- uint enterSerial = exec([=] {
+ uint enterSerial = exec([&] {
return pointer()->sendEnter(xdgSurface()->m_surface, {32, 32});
});
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
@@ -158,7 +158,7 @@ void tst_seatv4::usesEnterSerial()
void tst_seatv4::focusDestruction()
{
- QSignalSpy setCursorSpy(exec([=] { return pointer(); }), &Pointer::setCursor);
+ QSignalSpy setCursorSpy(exec([&] { return pointer(); }), &Pointer::setCursor);
QRasterWindow window;
window.resize(64, 64);
window.show();
@@ -166,7 +166,7 @@ void tst_seatv4::focusDestruction()
// Setting a cursor now is not allowed since there has been no enter event
QCOMPARE(setCursorSpy.count(), 0);
- uint enterSerial = exec([=] {
+ uint enterSerial = exec([&] {
return pointer()->sendEnter(xdgSurface()->m_surface, {32, 32});
});
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
@@ -298,7 +298,7 @@ void tst_seatv4::simpleAxis()
WheelWindow window;
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- exec([=] {
+ exec([&] {
Surface *surface = xdgSurface()->m_surface;
pointer()->sendEnter(surface, {32, 32});
wl_client *client = surface->resource()->client();
@@ -322,7 +322,7 @@ void tst_seatv4::invalidPointerEvents()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- exec([=] {
+ exec([&] {
auto *p = pointer();
auto *c = client();
// Purposefully send events without a wl_pointer.enter
@@ -355,7 +355,7 @@ static bool supportsCursorSizes(const QList<uint> &sizes)
{
auto *waylandIntegration = static_cast<QtWaylandClient::QWaylandIntegration *>(QGuiApplicationPrivate::platformIntegration());
wl_shm *shm = waylandIntegration->display()->shm()->object();
- return std::all_of(sizes.begin(), sizes.end(), [=](uint size) {
+ return std::all_of(sizes.begin(), sizes.end(), [&](uint size) {
return supportsCursorSize(size, shm);
});
}
@@ -384,15 +384,15 @@ void tst_seatv4::scaledCursor()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- exec([=] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
+ exec([&] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
QCOMPOSITOR_TRY_VERIFY(cursorSurface()->m_committed.buffer);
QCOMPOSITOR_TRY_COMPARE(cursorSurface()->m_committed.bufferScale, 1);
- QSize unscaledPixelSize = exec([=] {
+ QSize unscaledPixelSize = exec([&] {
return cursorSurface()->m_committed.buffer->size();
});
- exec([=] {
+ exec([&] {
auto *surface = cursorSurface();
surface->sendEnter(getAll<Output>()[1]);
surface->sendLeave(getAll<Output>()[0]);
@@ -412,7 +412,7 @@ void tst_seatv4::unscaledFallbackCursor()
const int screens = 4; // with scales 1, 2, 4, 8
- exec([=] {
+ exec([&] {
for (int i = 1; i < screens; ++i) {
OutputData d;
d.scale = int(qPow(2, i));
@@ -425,11 +425,11 @@ void tst_seatv4::unscaledFallbackCursor()
window.resize(64, 64);
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- exec([=] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
+ exec([&] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
QCOMPOSITOR_TRY_VERIFY(cursorSurface()->m_committed.buffer);
QCOMPOSITOR_TRY_COMPARE(cursorSurface()->m_committed.bufferScale, 1);
- QSize unscaledPixelSize = exec([=] {
+ QSize unscaledPixelSize = exec([&] {
return cursorSurface()->m_committed.buffer->size();
});
@@ -437,7 +437,7 @@ void tst_seatv4::unscaledFallbackCursor()
QCOMPARE(unscaledPixelSize.height(), int(defaultSize));
for (int i = 1; i < screens; ++i) {
- exec([=] {
+ exec([&] {
auto *surface = cursorSurface();
surface->sendEnter(getAll<Output>()[i]);
surface->sendLeave(getAll<Output>()[i-1]);
@@ -475,14 +475,14 @@ void tst_seatv4::bitmapCursor()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- exec([=] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
+ exec([&] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
QCOMPOSITOR_TRY_VERIFY(cursorSurface()->m_committed.buffer);
QCOMPOSITOR_COMPARE(cursorSurface()->m_committed.buffer->size(), QSize(24, 24));
QCOMPOSITOR_COMPARE(cursorSurface()->m_committed.bufferScale, 1);
QCOMPOSITOR_COMPARE(pointer()->m_hotspot, QPoint(12, 12));
- exec([=] {
+ exec([&] {
auto *surface = cursorSurface();
surface->sendEnter(getAll<Output>()[1]);
surface->sendLeave(getAll<Output>()[0]);
@@ -521,14 +521,14 @@ void tst_seatv4::hidpiBitmapCursor()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- exec([=] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
+ exec([&] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
QCOMPOSITOR_TRY_VERIFY(cursorSurface()->m_committed.buffer);
QCOMPOSITOR_COMPARE(cursorSurface()->m_committed.buffer->size(), QSize(48, 48));
QCOMPOSITOR_COMPARE(cursorSurface()->m_committed.bufferScale, 2);
QCOMPOSITOR_COMPARE(pointer()->m_hotspot, QPoint(12, 12));
- exec([=] {
+ exec([&] {
auto *surface = cursorSurface();
surface->sendEnter(getAll<Output>()[1]);
surface->sendLeave(getAll<Output>()[0]);
@@ -558,7 +558,7 @@ void tst_seatv4::hidpiBitmapCursorNonInt()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- exec([=] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
+ exec([&] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
QCOMPOSITOR_TRY_VERIFY(cursorSurface()->m_committed.buffer);
QCOMPOSITOR_COMPARE(cursorSurface()->m_committed.buffer->size(), QSize(100, 100));
@@ -576,12 +576,12 @@ void tst_seatv4::animatedCursor()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
- exec([=] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
+ exec([&] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); });
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
// We should get the first buffer without waiting for a frame callback
QCOMPOSITOR_TRY_VERIFY(cursorSurface()->m_committed.buffer);
- QSignalSpy bufferSpy(exec([=] { return cursorSurface(); }), &Surface::bufferCommitted);
+ QSignalSpy bufferSpy(exec([&] { return cursorSurface(); }), &Surface::bufferCommitted);
exec([&] {
// Make sure no extra buffers have arrived