[neon/qt/qtwayland/Neon/unstable] debian: Add patches from KDE’s Qt 5 Patch Collection up to 2023-04-07.
Dmitry Shachnev
null at kde.org
Mon Apr 29 17:44:39 BST 2024
Git commit 03cc88613766a39246c9e465863b7fec5f1db4f9 by Dmitry Shachnev.
Committed on 22/04/2023 at 15:03.
Pushed by jriddell into branch 'Neon/unstable'.
Add patches from KDE’s Qt 5 Patch Collection up to 2023-04-07.
M +1 -0 debian/changelog
A +33 -0 debian/patches/0065-Client-Fix-handling-of-Qt-BlankCursor.patch
A +105 -0 debian/patches/0066-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch
A +127 -0 debian/patches/0067-Client-Manage-QMimeData-lifecycle.patch
A +28 -0 debian/patches/0068-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch
A +36 -0 debian/patches/0069-Client-Remove-flip-popup-constraints.patch
M +5 -0 debian/patches/series
https://invent.kde.org/neon/qt/qtwayland/-/commit/03cc88613766a39246c9e465863b7fec5f1db4f9
diff --git a/debian/changelog b/debian/changelog
index 1cd7933..05f6266 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ qtwayland-opensource-src (5.15.9-1) UNRELEASED; urgency=medium
- 0050-Fix-missing-update-when-toggling-client-side-decorat.patch
- 0052-Client-support-high-dpi-mode-for-window-icon.patch
* Refresh other patches.
+ * Add patches from KDE’s Qt 5 Patch Collection up to 2023-04-07.
-- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Sat, 22 Apr 2023 16:58:13 +0300
diff --git a/debian/patches/0065-Client-Fix-handling-of-Qt-BlankCursor.patch b/debian/patches/0065-Client-Fix-handling-of-Qt-BlankCursor.patch
new file mode 100644
index 0000000..3bfd9fb
--- /dev/null
+++ b/debian/patches/0065-Client-Fix-handling-of-Qt-BlankCursor.patch
@@ -0,0 +1,33 @@
+From fbb9d65cf158bcf63440e9839acae9238ad4e0a7 Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vlad.zahorodnii at kde.org>
+Date: Tue, 22 Nov 2022 23:27:34 +0200
+Subject: [PATCH] Client: Fix handling of Qt::BlankCursor
+
+The cursor may not be properly set when a window has Qt::BlankCursor and
+it's shown. In that case, the cursor surface may not be present and
+wl_pointer.set_cursor won't be called.
+
+On the other hand, wl_pointer.set_cursor must be always called when
+wl_pointer.enter is received.
+
+Pick-to: 6.5
+Change-Id: I8540e7a02df1579b3380a1a1d4cfab42c1ab3104
+Reviewed-by: David Edmundson <davidedmundson at kde.org>
+Reviewed-by: Qt CI Bot <qt_ci_bot at qt-project.org>
+(cherry picked from commit e954853f0e68d78ac1a98bc3533713881496064c)
+---
+ src/client/qwaylandinputdevice.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/src/client/qwaylandinputdevice.cpp
++++ b/src/client/qwaylandinputdevice.cpp
+@@ -310,8 +310,7 @@ void QWaylandInputDevice::Pointer::updateCursor()
+ auto shape = seat()->mCursor.shape;
+
+ if (shape == Qt::BlankCursor) {
+- if (mCursor.surface)
+- mCursor.surface->hide();
++ getOrCreateCursorSurface()->hide();
+ return;
+ }
+
diff --git a/debian/patches/0066-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch b/debian/patches/0066-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch
new file mode 100644
index 0000000..f101def
--- /dev/null
+++ b/debian/patches/0066-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch
@@ -0,0 +1,105 @@
+From 6897f62f603df049135347cf402a7a4037092263 Mon Sep 17 00:00:00 2001
+From: Marco Martin <notmart at gmail.com>
+Date: Fri, 24 Feb 2023 17:40:48 +0100
+Subject: [PATCH] client: Force a roundtrip when an XdgOutput is not ready yet
+
+Is possible that the server sends a surface_enter before
+all the information of the XdgOutput have been processed by the client.
+in this case the associated QScreen doesn't exist yet, causing a
+QWindow::SetScreen(nullptr), which will fall back to
+QGuiApplication::primaryScreen(), having the QWindow being assigned the
+wrong screen
+
+Change-Id: I923d5d3a35484deafa6f0572f79c16c27b1f87f0
+Reviewed-by: David Edmundson <davidedmundson at kde.org>
+---
+ src/client/qwaylandwindow.cpp | 2 ++
+ tests/auto/client/shared/coreprotocol.cpp | 2 ++
+ tests/auto/client/shared/coreprotocol.h | 3 ++
+ tests/auto/client/xdgoutput/tst_xdgoutput.cpp | 35 +++++++++++++++++++
+ 4 files changed, 42 insertions(+)
+
+--- a/src/client/qwaylandwindow.cpp
++++ b/src/client/qwaylandwindow.cpp
+@@ -1042,6 +1042,8 @@ void QWaylandWindow::handleScreensChanged()
+ if (newScreen == mLastReportedScreen)
+ return;
+
++ if (!newScreen->isPlaceholder() && !newScreen->QPlatformScreen::screen())
++ mDisplay->forceRoundTrip();
+ QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->QPlatformScreen::screen());
+ mLastReportedScreen = newScreen;
+ if (fixedToplevelPositions && !QPlatformWindow::parent() && window()->type() != Qt::Popup
+--- a/tests/auto/client/shared/coreprotocol.cpp
++++ b/tests/auto/client/shared/coreprotocol.cpp
+@@ -185,6 +185,8 @@ void Output::output_bind_resource(QtWaylandServer::wl_output::Resource *resource
+
+ if (m_version >= WL_OUTPUT_DONE_SINCE_VERSION)
+ wl_output::send_done(resource->handle);
++
++ Q_EMIT outputBound(resource);
+ }
+
+ // Seat stuff
+--- a/tests/auto/client/shared/coreprotocol.h
++++ b/tests/auto/client/shared/coreprotocol.h
+@@ -273,6 +273,9 @@ public:
+ OutputData m_data;
+ int m_version = 1; // TODO: remove on libwayland upgrade
+
++Q_SIGNALS:
++ void outputBound(Resource *resource);
++
+ protected:
+ void output_bind_resource(Resource *resource) override;
+ };
+--- a/tests/auto/client/xdgoutput/tst_xdgoutput.cpp
++++ b/tests/auto/client/xdgoutput/tst_xdgoutput.cpp
+@@ -55,6 +55,7 @@ private slots:
+ void primaryScreen();
+ void overrideGeometry();
+ void changeGeometry();
++ void outputCreateEnterRace();
+ };
+
+ void tst_xdgoutput::cleanup()
+@@ -134,5 +135,39 @@ void tst_xdgoutput::changeGeometry()
+ exec([=] { remove(output(1)); });
+ }
+
++void tst_xdgoutput::outputCreateEnterRace()
++{
++ m_config.autoConfigure = true;
++ m_config.autoEnter = false;
++ QRasterWindow window;
++ QSignalSpy screenChanged(&window, &QWindow::screenChanged);
++ window.resize(400, 320);
++ window.show();
++ QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
++ exec([=] { xdgToplevel()->surface()->sendEnter(output(0));});
++
++ QTRY_COMPARE(QGuiApplication::screens().size(), 1);
++ QScreen *primaryScreen = QGuiApplication::screens().first();
++ QCOMPARE(window.screen(), primaryScreen);
++
++ auto *out = exec([=] {
++ return add<Output>();
++ });
++
++ // In Compositor Thread
++ connect(out, &Output::outputBound, this, [this](QtWaylandServer::wl_output::Resource *resource){
++ auto surface = xdgToplevel()->surface();
++ surface->sendLeave(output(0));
++ surface->QtWaylandServer::wl_surface::send_enter(surface->resource()->handle, resource->handle);
++ }, Qt::DirectConnection);
++
++ QTRY_COMPARE(QGuiApplication::screens().size(), 2);
++ QTRY_COMPARE(window.screen(), QGuiApplication::screens()[1]);
++
++ exec([=] { remove(out); });
++ m_config.autoConfigure = false;
++ m_config.autoEnter = true;
++}
++
+ QCOMPOSITOR_TEST_MAIN(tst_xdgoutput)
+ #include "tst_xdgoutput.moc"
diff --git a/debian/patches/0067-Client-Manage-QMimeData-lifecycle.patch b/debian/patches/0067-Client-Manage-QMimeData-lifecycle.patch
new file mode 100644
index 0000000..a4c1975
--- /dev/null
+++ b/debian/patches/0067-Client-Manage-QMimeData-lifecycle.patch
@@ -0,0 +1,127 @@
+From 31eab11d3b6697a76cc7802d02e525c1152a42c2 Mon Sep 17 00:00:00 2001
+From: Tang Haixiang <tanghaixiang at uniontech.com>
+Date: Thu, 22 Dec 2022 15:19:53 +0800
+Subject: [PATCH] Client: Manage QMimeData lifecycle
+
+QMimeData is created by user, it is not taken care of in qtwayland,
+which will cause memory leak.
+
+It is now handled in qtwayland that when a new QMimeData is set,
+the previous QMimeData is freed.
+
+Change-Id: Ic502021fe700c7ee10454d94f0d1868901809af7
+Reviewed-by: David Edmundson <davidedmundson at kde.org>
+Reviewed-by: Qt CI Bot <qt_ci_bot at qt-project.org>
+(cherry picked from commit 3af40c6c42703a65656fdd3322183abb2905e44d)
+---
+ src/client/qwaylandclipboard.cpp | 27 +++++++++++++++++++++------
+ src/client/qwaylandclipboard_p.h | 1 +
+ src/client/qwaylanddatasource.cpp | 5 -----
+ src/client/qwaylanddatasource_p.h | 2 --
+ 4 files changed, 22 insertions(+), 13 deletions(-)
+
+--- a/src/client/qwaylandclipboard.cpp
++++ b/src/client/qwaylandclipboard.cpp
+@@ -54,10 +54,15 @@ namespace QtWaylandClient {
+ QWaylandClipboard::QWaylandClipboard(QWaylandDisplay *display)
+ : mDisplay(display)
+ {
++ m_clientClipboard[QClipboard::Clipboard] = nullptr;
++ m_clientClipboard[QClipboard::Selection] = nullptr;
+ }
+
+ QWaylandClipboard::~QWaylandClipboard()
+ {
++ if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection])
++ delete m_clientClipboard[QClipboard::Clipboard];
++ delete m_clientClipboard[QClipboard::Selection];
+ }
+
+ QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode)
+@@ -69,8 +74,8 @@ QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode)
+ switch (mode) {
+ case QClipboard::Clipboard:
+ if (auto *dataDevice = seat->dataDevice()) {
+- if (auto *source = dataDevice->selectionSource())
+- return source->mimeData();
++ if (dataDevice->selectionSource())
++ return m_clientClipboard[QClipboard::Clipboard];
+ if (auto *offer = dataDevice->selectionOffer())
+ return offer->mimeData();
+ }
+@@ -78,8 +83,8 @@ QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode)
+ case QClipboard::Selection:
+ #if QT_CONFIG(wayland_client_primary_selection)
+ if (auto *selectionDevice = seat->primarySelectionDevice()) {
+- if (auto *source = selectionDevice->selectionSource())
+- return source->mimeData();
++ if (selectionDevice->selectionSource())
++ return m_clientClipboard[QClipboard::Selection];
+ if (auto *offer = selectionDevice->selectionOffer())
+ return offer->mimeData();
+ }
+@@ -104,17 +109,27 @@ void QWaylandClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
+ if (data && data->hasFormat(plain) && !data->hasFormat(utf8))
+ data->setData(utf8, data->data(plain));
+
++ if (m_clientClipboard[mode]) {
++ if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection])
++ delete m_clientClipboard[mode];
++ m_clientClipboard[mode] = nullptr;
++ }
++
++ m_clientClipboard[mode] = data;
++
+ switch (mode) {
+ case QClipboard::Clipboard:
+ if (auto *dataDevice = seat->dataDevice()) {
+- dataDevice->setSelectionSource(data ? new QWaylandDataSource(mDisplay->dndSelectionHandler(), data) : nullptr);
++ dataDevice->setSelectionSource(data ? new QWaylandDataSource(mDisplay->dndSelectionHandler(),
++ m_clientClipboard[QClipboard::Clipboard]) : nullptr);
+ emitChanged(mode);
+ }
+ break;
+ case QClipboard::Selection:
+ #if QT_CONFIG(wayland_client_primary_selection)
+ if (auto *selectionDevice = seat->primarySelectionDevice()) {
+- selectionDevice->setSelectionSource(data ? new QWaylandPrimarySelectionSourceV1(mDisplay->primarySelectionManager(), data) : nullptr);
++ selectionDevice->setSelectionSource(data ? new QWaylandPrimarySelectionSourceV1(mDisplay->primarySelectionManager(),
++ m_clientClipboard[QClipboard::Selection]) : nullptr);
+ emitChanged(mode);
+ }
+ #endif
+--- a/src/client/qwaylandclipboard_p.h
++++ b/src/client/qwaylandclipboard_p.h
+@@ -80,6 +80,7 @@ public:
+ private:
+ QWaylandDisplay *mDisplay = nullptr;
+ QMimeData m_emptyData;
++ QMimeData *m_clientClipboard[2];
+ };
+
+ }
+--- a/src/client/qwaylanddatasource.cpp
++++ b/src/client/qwaylanddatasource.cpp
+@@ -71,11 +71,6 @@ QWaylandDataSource::~QWaylandDataSource()
+ destroy();
+ }
+
+-QMimeData * QWaylandDataSource::mimeData() const
+-{
+- return m_mime_data;
+-}
+-
+ void QWaylandDataSource::data_source_cancelled()
+ {
+ Q_EMIT cancelled();
+--- a/src/client/qwaylanddatasource_p.h
++++ b/src/client/qwaylanddatasource_p.h
+@@ -74,8 +74,6 @@ public:
+ QWaylandDataSource(QWaylandDataDeviceManager *dataDeviceManager, QMimeData *mimeData);
+ ~QWaylandDataSource() override;
+
+- QMimeData *mimeData() const;
+-
+ Q_SIGNALS:
+ void cancelled();
+ void finished();
diff --git a/debian/patches/0068-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch b/debian/patches/0068-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch
new file mode 100644
index 0000000..22f624e
--- /dev/null
+++ b/debian/patches/0068-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch
@@ -0,0 +1,28 @@
+From 18c2bcec31f68aafd66d7ec503ec6511ca804d07 Mon Sep 17 00:00:00 2001
+From: Aleix Pol <aleixpol at kde.org>
+Date: Mon, 6 Mar 2023 01:11:45 +0100
+Subject: [PATCH] client: Do not cast placeholder screens to QWaylandScreen
+
+It's wrong to C-cast an object to a class that isn't theirs. Check if it
+is a placeholder first.
+
+Pick-to: 5.15 6.2 6.5
+Change-Id: I45d3c423422ae6638a033fb0f4cfefc7cd4460f0
+Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt at qt.io>
+Reviewed-by: David Edmundson <davidedmundson at kde.org>
+(cherry picked from commit a53f022393a1276dbf8eccbae04cb0bd6cea0160)
+---
+ src/client/qwaylandnativeinterface.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/client/qwaylandnativeinterface.cpp
++++ b/src/client/qwaylandnativeinterface.cpp
+@@ -139,7 +139,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc
+ {
+ QByteArray lowerCaseResource = resourceString.toLower();
+
+- if (lowerCaseResource == "output")
++ if (lowerCaseResource == "output" && !screen->handle()->isPlaceholder())
+ return ((QWaylandScreen *) screen->handle())->output();
+
+ return nullptr;
diff --git a/debian/patches/0069-Client-Remove-flip-popup-constraints.patch b/debian/patches/0069-Client-Remove-flip-popup-constraints.patch
new file mode 100644
index 0000000..58fb826
--- /dev/null
+++ b/debian/patches/0069-Client-Remove-flip-popup-constraints.patch
@@ -0,0 +1,36 @@
+From c4c3fc69250c01cb35aaae5ea1ea2bcc8236dff0 Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vlad.zahorodnii at kde.org>
+Date: Thu, 12 Jan 2023 14:49:25 +0200
+Subject: [PATCH] Client: Remove flip popup constraints
+
+xdg_positioner doesn't have good anchor rect and other needed
+information so the compositor can properly flip popups. In some windows
+I see that some popups are flipped in such a way that the popups look
+"detached" from the parent window.
+
+With the information that QtWayland provides so far only slide
+constraint adjustments can produce somewhat expected results. Although
+there will be still some issues near screen edges.
+
+Pick-to: 6.5 6.4 6.2 5.15
+Task-number: QTBUG-87303
+Change-Id: I4021f497b78e62651fe606c4be21a387a92edd6c
+Reviewed-by: Liang Qi <liang.qi at qt.io>
+(cherry picked from commit d7a5dab0182cba19d7f59e542672aa3d1b2e859e)
+---
+ src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+@@ -425,9 +425,7 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
+ positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right);
+ positioner->set_size(m_window->geometry().width(), m_window->geometry().height());
+ positioner->set_constraint_adjustment(QtWayland::xdg_positioner::constraint_adjustment_slide_x
+- | QtWayland::xdg_positioner::constraint_adjustment_slide_y
+- | QtWayland::xdg_positioner::constraint_adjustment_flip_x
+- | QtWayland::xdg_positioner::constraint_adjustment_flip_y);
++ | QtWayland::xdg_positioner::constraint_adjustment_slide_y);
+ m_popup = new Popup(this, parent, positioner);
+ positioner->destroy();
+
diff --git a/debian/patches/series b/debian/patches/series
index af76c45..16b70b6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -48,4 +48,9 @@
0062-Client-Handle-zwp_primary_selection_device_manager_v.patch
0063-Fixes-the-build-on-CentOS.patch
0064-client-Avoid-protocol-error-with-invalid-min-max-siz.patch
+0065-Client-Fix-handling-of-Qt-BlankCursor.patch
+0066-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch
+0067-Client-Manage-QMimeData-lifecycle.patch
+0068-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch
+0069-Client-Remove-flip-popup-constraints.patch
skip_animated_cursor_test.diff
More information about the Neon-commits
mailing list