From 1887f6b4b6e689dcb1c60f1e78fffac31e5ce4a6 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Mon, 4 Oct 2021 16:31:30 -0400 Subject: Fix the logic for decoding modifiers map in Wayland text input protocol Correctly check for the flags in the modifiers map when we get it from the compositor, instead of modifying the map in the for loop conditional. [ChangeLog][QWaylandInputContext] Fix modifiers map decoding logic when receiving the map from the compositor. Fixes: QTBUG-97094 Change-Id: Idad19f7b1f4560d40abbb5b31032360cfe915261 Reviewed-by: Paul Olav Tvete (cherry picked from commit baa7ef511bf40280448e5f0e721ddd6da3301f3b) Reviewed-by: Qt Cherry-pick Bot --- src/client/qwaylandinputcontext.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp index 0151dfc9b..c26f95584 100644 --- a/src/client/qwaylandinputcontext.cpp +++ b/src/client/qwaylandinputcontext.cpp @@ -387,8 +387,10 @@ void QWaylandTextInput::zwp_text_input_v2_input_method_changed(uint32_t serial, Qt::KeyboardModifiers QWaylandTextInput::modifiersToQtModifiers(uint32_t modifiers) { Qt::KeyboardModifiers ret = Qt::NoModifier; - for (int i = 0; modifiers >>= 1; ++i) { - ret |= m_modifiersMap[i]; + for (int i = 0; i < m_modifiersMap.size(); ++i) { + if (modifiers & (1 << i)) { + ret |= m_modifiersMap[i]; + } } return ret; } -- cgit v1.2.3 From 35bafb1920e265788deff10bb8fb140792a869c4 Mon Sep 17 00:00:00 2001 From: Tarja Sundqvist Date: Mon, 8 Nov 2021 18:28:31 +0200 Subject: Bump version --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 7c9136780..e95d63bc6 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -4,4 +4,4 @@ DEFINES += QT_NO_FOREACH DEFINES += QT_NO_JAVA_STYLE_ITERATORS DEFINES += QT_NO_LINKED_LIST -MODULE_VERSION = 5.15.7 +MODULE_VERSION = 5.15.8 -- cgit v1.2.3 From a9433f46e873baf2319bdb934012b9eca4499721 Mon Sep 17 00:00:00 2001 From: Inho Lee Date: Mon, 1 Nov 2021 14:23:58 +0100 Subject: Do not create decorations when the shellSurface is not ready A cases reported that client windows try to make decorations when their shell surfaces are null. Since the surfaces' requests for decorations should be applied, those case will be failed to create decorations. This patch was modified by Paul Tvete's advice. (paul.tvete@qt.io) Task-number: QTBUG-97608 Change-Id: I2563dbd73b730f81cc411857af07da99ceb2d063 Reviewed-by: Paul Olav Tvete (cherry picked from commit 246f0c0bc01dd059bf8165e81f7b49efa36e4d95) Reviewed-by: Qt Cherry-pick Bot --- src/client/qwaylandwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 746cc4cfc..6033f6129 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -821,7 +821,7 @@ bool QWaylandWindow::createDecoration() decoration = false; if (mSubSurfaceWindow) decoration = false; - if (mShellSurface && !mShellSurface->wantsDecorations()) + if (!mShellSurface || !mShellSurface->wantsDecorations()) decoration = false; bool hadDecoration = mWindowDecoration; -- cgit v1.2.3 From 18379b45fce9ed0247f9d20153e5f52925d9cd42 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 16 Nov 2021 17:53:00 +0100 Subject: tst_seatv4: fix deprecated implicit capture of this by [=] Since exec() is a synchronous call, we can just take everything by reference instead. Change-Id: Ic1588db69ed6bb0d8dd39ff0439ad0fc97dd957f Reviewed-by: David Edmundson (cherry picked from commit 550c867ead52c575b9d7117754d8c935916f0bb7) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/client/seatv4/tst_seatv4.cpp | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/auto/client/seatv4/tst_seatv4.cpp b/tests/auto/client/seatv4/tst_seatv4.cpp index 2e17bef87..a795637bf 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 QVector &sizes) { auto *waylandIntegration = static_cast(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()[1]); surface->sendLeave(getAll()[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()[i]); surface->sendLeave(getAll()[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()[1]); surface->sendLeave(getAll()[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()[1]); surface->sendLeave(getAll()[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 -- cgit v1.2.3 From fbe581ad49517e888cec221e72363c58b0a15575 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 16 Nov 2021 18:01:41 +0100 Subject: tst_seatv4: fix compilation with GCC/C++20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explicitly defaulting the default ctor suppresses aggregate initialization. It's also a pointless thing to do, so don't do it. Change-Id: I8ec14f22ae1ead2dd6db643a6462f719fda344b8 Reviewed-by: David Edmundson (cherry picked from commit 6f195a592b26ad8416a6f02d6bd7258ab3fadf65) Reviewed-by: Qt CI Bot Reviewed-by: MÃ¥rten Nordheim --- tests/auto/client/seatv4/tst_seatv4.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/client/seatv4/tst_seatv4.cpp b/tests/auto/client/seatv4/tst_seatv4.cpp index a795637bf..b92c3dbea 100644 --- a/tests/auto/client/seatv4/tst_seatv4.cpp +++ b/tests/auto/client/seatv4/tst_seatv4.cpp @@ -287,8 +287,6 @@ void tst_seatv4::simpleAxis() } struct Event // Because I didn't find a convenient way to copy it entirely { - Event() = default; - const QPoint pixelDelta; const QPoint angleDelta; // eights of a degree, positive is upwards, left }; -- cgit v1.2.3 From a64c7ab8359ba40f86a04808ce29310fb332f088 Mon Sep 17 00:00:00 2001 From: Inho Lee Date: Thu, 23 Sep 2021 19:59:08 +0200 Subject: Use a correct serial for xdg_surface.ack_configure Previous pendingConfigureSerial can be overwritten regardless of the current configuration. With this patch, the client surface can use correct serial for xdg_surface.ack_configure. Fixes: QTBUG-95962 Change-Id: I849d2daf4acc8ef6e7f8528af9c5a57f671f43e6 Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit 07ddfbfa43d08c2b76aabafaab38830e04a42690) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 9 +++++---- src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index 365a6c4ed..9d419a901 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -335,15 +335,16 @@ bool QWaylandXdgSurface::handleExpose(const QRegion ®ion) void QWaylandXdgSurface::applyConfigure() { - Q_ASSERT(m_pendingConfigureSerial != 0); + // It is a redundant ack_configure, so skipped. + if (m_pendingConfigureSerial == m_appliedConfigureSerial) + return; if (m_toplevel) m_toplevel->applyConfigure(); + m_appliedConfigureSerial = m_pendingConfigureSerial; m_configured = true; - ack_configure(m_pendingConfigureSerial); - - m_pendingConfigureSerial = 0; + ack_configure(m_appliedConfigureSerial); } bool QWaylandXdgSurface::wantsDecorations() const diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h index c1450ee3c..1e3e8ec10 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h @@ -153,6 +153,7 @@ private: bool m_configured = false; QRegion m_exposeRegion; uint m_pendingConfigureSerial = 0; + uint m_appliedConfigureSerial = 0; friend class QWaylandXdgShell; }; -- cgit v1.2.3