From 03d7577cc0998f41158de06c5a3a60efc44ce6b6 Mon Sep 17 00:00:00 2001 From: tigro Date: Mon, 6 Jan 2025 08:06:15 +0300 Subject: [PATCH] import qt5-qtwayland-5.15.15-1.el10 --- .gitignore | 2 +- .qt5-qtwayland.metadata | 2 +- ...an-output-after-receiving-more-compl.patch | 6 +- ...ue-with-repeated-window-size-changes.patch | 12 +- ...rags-being-accepted-to-updating-the-.patch | 8 +- ...ect-registry-listener-on-destruction.patch | 8 +- ...ell-size-hints-before-the-first-comm.patch | 12 +- SOURCES/0006-Fix-build.patch | 8 +- SOURCES/0007-Fix-remove-listener.patch | 8 +- .../0008-Hook-up-queryKeyboardModifers.patch | 6 +- ...-if-image-format-is-supported-by-QIm.patch | 8 +- ...on-t-always-recreate-frame-callbacks.patch | 12 +- ...stroy-frame-callback-in-the-actual-c.patch | 10 +- ...se-wl_keyboard-to-determine-active-s.patch | 18 +- ...pty-clipboard-when-a-new-popup-windo.patch | 12 +- .../0014-Client-Implement-DataDeviceV3.patch | 21 +- ...etion-of-QDrag-object-until-after-we.patch | 6 +- ...cessing-of-events-when-showing-windo.patch | 8 +- ...e-registry_global-out-of-constructor.patch | 8 +- ...ct-flushRequest-after-forceRoundTrip.patch | 6 +- ...-socket-polling-to-a-separate-event-.patch | 22 +- ...ent-Remove-mWaitingForUpdateDelivery.patch | 8 +- ...-client-Simplify-round-trip-behavior.patch | 8 +- ...0022-Client-Fix-opaque-region-setter.patch | 8 +- ...proper-dependencies-in-compile-tests.patch | 52 +-- ...ent-Remove-mWaitingForUpdateDelivery.patch | 8 +- ...ndition-on-mWaitingForUpdateDelivery.patch | 8 +- ...e-poll-2-when-reading-from-clipboard.patch | 6 +- SOURCES/0027-Reduce-memory-leakage.patch | 8 +- ...ld-with-libcxx-missing-array-include.patch | 32 -- ...ly-close-popup-in-the-the-hierchary.patch} | 28 +- ...inter-for-null-before-use-in-ASSERT.patch} | 8 +- SOURCES/0030-Build-fixes-for-GCC-11.patch | 28 -- ...ce.damage_buffer-on-the-client-side.patch} | 10 +- ...-Client-clear-focus-on-touch-cancel.patch} | 10 +- ...rd-mResizeDirty-by-the-correctMutex.patch} | 8 +- ...sts.patch => 0033-Fix-compile-tests.patch} | 6 +- ...n-QWaylandDataDevice-dragSourceCanc.patch} | 8 +- ...-lock-throughout-QWaylandEglWindow-.patch} | 8 +- ...e-enter-leave-event-for-popup-in-xdg.patch | 72 ----- ...dows-in-the-top-left-corner-of-the-.patch} | 14 +- ...EAL_SHRINK-seal-to-shm-backing-file.patch} | 6 +- ...ine-delimiter-for-text-uri-list-data.patch | 40 --- ...ling-requestUpdate-from-wrong-thread.patch | 43 --- ...tput_release-upon-QWaylandScreen-de.patch} | 6 +- ... 0039-Client-Bump-wl_output-version.patch} | 6 +- ...lated-to-unprotected-multithread-ac.patch} | 12 +- ...at-wl_surface-lives-as-long-as-qtqui.patch | 109 ------- ..._primary_selection_device_manager_v.patch} | 10 +- ...h => 0042-Fixes-the-build-on-CentOS.patch} | 6 +- ...sure-that-wl_surface-lives-as-long-a.patch | 103 ------ ...ocol-error-with-invalid-min-max-siz.patch} | 8 +- ...ient-Fix-handling-of-Qt-BlankCursor.patch} | 8 +- ...undtrip-when-an-XdgOutput-is-not-re.patch} | 12 +- ...6-Destroy-frame-queue-before-display.patch | 38 +++ ...-on-dnd-updates-after-client-facing-.patch | 42 +++ ...rt-cursor-bitmap-to-supported-format.patch | 66 ++++ ...th-devicePixelRatio-for-non-integer-.patch | 169 ++++++++++ SOURCES/0050-Client-Fix-buffer-damage.patch | 71 +++++ ...the-initial-surface-state-explicitly.patch | 37 +++ ...52-tests-Fix-tst_xdgshell-minMaxSize.patch | 35 ++ ...53-Client-Manage-QMimeData-lifecycle.patch | 138 -------- ...3-Client-Remove-some-surface-commits.patch | 62 ++++ ...king-resizing-in-QWaylandShmBackingS.patch | 69 ++++ ...st-placeholder-screens-to-QWaylandSc.patch | 34 -- ...nt-Always-populate-mimedata-in-drags.patch | 52 +++ ...Client-Remove-flip-popup-constraints.patch | 41 --- ...-event-cursor-position-with-xdg-popu.patch | 60 ++++ ...t-cache-one-type-in-QWaylandMimeData.patch | 47 +++ ...-Fix-race-condition-in-drag-and-drop.patch | 76 +++++ ...nd-release-button-event-on-pointer-l.patch | 75 +++++ ...client-fix-window-margin-calculation.patch | 29 ++ ...coration-support-backports-from-qt6.patch} | 154 ++++++--- ...d-use-adwaita-decorations-by-default.patch | 14 + SPECS/qt5-qtwayland.spec | 300 +++++++++++------- 75 files changed, 1467 insertions(+), 1052 deletions(-) delete mode 100644 SOURCES/0028-Fix-build-with-libcxx-missing-array-include.patch rename SOURCES/{0029-Only-close-popup-in-the-the-hierchary.patch => 0028-Only-close-popup-in-the-the-hierchary.patch} (95%) rename SOURCES/{0031-Check-pointer-for-null-before-use-in-ASSERT.patch => 0029-Check-pointer-for-null-before-use-in-ASSERT.patch} (84%) delete mode 100644 SOURCES/0030-Build-fixes-for-GCC-11.patch rename SOURCES/{0032-Use-wl_surface.damage_buffer-on-the-client-side.patch => 0030-Use-wl_surface.damage_buffer-on-the-client-side.patch} (96%) rename SOURCES/{0033-Client-clear-focus-on-touch-cancel.patch => 0031-Client-clear-focus-on-touch-cancel.patch} (94%) rename SOURCES/{0034-Guard-mResizeDirty-by-the-correctMutex.patch => 0032-Guard-mResizeDirty-by-the-correctMutex.patch} (88%) rename SOURCES/{0036-Fix-compile-tests.patch => 0033-Fix-compile-tests.patch} (90%) rename SOURCES/{0039-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch => 0034-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch} (88%) rename SOURCES/{0040-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch => 0035-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch} (95%) delete mode 100644 SOURCES/0035-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch rename SOURCES/{0042-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch => 0036-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch} (90%) rename SOURCES/{0044-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch => 0037-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch} (92%) delete mode 100644 SOURCES/0037-Use-CRLF-line-delimiter-for-text-uri-list-data.patch delete mode 100644 SOURCES/0038-Avoid-calling-requestUpdate-from-wrong-thread.patch rename SOURCES/{0045-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch => 0038-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch} (87%) rename SOURCES/{0046-Client-Bump-wl_output-version.patch => 0039-Client-Bump-wl_output-version.patch} (89%) rename SOURCES/{0047-Fix-frame-sync-related-to-unprotected-multithread-ac.patch => 0040-Fix-frame-sync-related-to-unprotected-multithread-ac.patch} (95%) delete mode 100644 SOURCES/0041-Client-Ensure-that-wl_surface-lives-as-long-as-qtqui.patch rename SOURCES/{0048-Client-Handle-zwp_primary_selection_device_manager_v.patch => 0041-Client-Handle-zwp_primary_selection_device_manager_v.patch} (93%) rename SOURCES/{0049-Fixes-the-build-on-CentOS.patch => 0042-Fixes-the-build-on-CentOS.patch} (87%) delete mode 100644 SOURCES/0043-Revert-Client-Ensure-that-wl_surface-lives-as-long-a.patch rename SOURCES/{0050-client-Avoid-protocol-error-with-invalid-min-max-siz.patch => 0043-client-Avoid-protocol-error-with-invalid-min-max-siz.patch} (93%) rename SOURCES/{0051-Client-Fix-handling-of-Qt-BlankCursor.patch => 0044-Client-Fix-handling-of-Qt-BlankCursor.patch} (87%) rename SOURCES/{0052-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch => 0045-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch} (94%) create mode 100644 SOURCES/0046-Destroy-frame-queue-before-display.patch create mode 100644 SOURCES/0047-client-Fix-crash-on-dnd-updates-after-client-facing-.patch create mode 100644 SOURCES/0048-Convert-cursor-bitmap-to-supported-format.patch create mode 100644 SOURCES/0049-Replace-scale-with-devicePixelRatio-for-non-integer-.patch create mode 100644 SOURCES/0050-Client-Fix-buffer-damage.patch create mode 100644 SOURCES/0051-Client-Commit-the-initial-surface-state-explicitly.patch create mode 100644 SOURCES/0052-tests-Fix-tst_xdgshell-minMaxSize.patch delete mode 100644 SOURCES/0053-Client-Manage-QMimeData-lifecycle.patch create mode 100644 SOURCES/0053-Client-Remove-some-surface-commits.patch create mode 100644 SOURCES/0054-Client-Avoid-locking-resizing-in-QWaylandShmBackingS.patch delete mode 100644 SOURCES/0054-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch create mode 100644 SOURCES/0055-Client-Always-populate-mimedata-in-drags.patch delete mode 100644 SOURCES/0055-Client-Remove-flip-popup-constraints.patch create mode 100644 SOURCES/0056-Client-Fix-enter-event-cursor-position-with-xdg-popu.patch create mode 100644 SOURCES/0057-client-don-t-cache-one-type-in-QWaylandMimeData.patch create mode 100644 SOURCES/0058-Fix-race-condition-in-drag-and-drop.patch create mode 100644 SOURCES/0059-Revert-Client-Send-release-button-event-on-pointer-l.patch create mode 100644 SOURCES/qtwayland-client-fix-window-margin-calculation.patch rename SOURCES/{qtwayland-client-expose-toplevel-window-state.patch => qtwayland-decoration-support-backports-from-qt6.patch} (57%) create mode 100644 SOURCES/qtwayland-use-adwaita-decorations-by-default.patch diff --git a/.gitignore b/.gitignore index 6520d65..32e32f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/qtwayland-everywhere-opensource-src-5.15.9.tar.xz +SOURCES/qtwayland-everywhere-opensource-src-5.15.15.tar.xz diff --git a/.qt5-qtwayland.metadata b/.qt5-qtwayland.metadata index a04bb33..7b053fa 100644 --- a/.qt5-qtwayland.metadata +++ b/.qt5-qtwayland.metadata @@ -1 +1 @@ -dcaac92b52d681c9d13330e78fcd745005269fdc SOURCES/qtwayland-everywhere-opensource-src-5.15.9.tar.xz +171583a180bd291a0f21021dfc721b96e1d5a9f1 SOURCES/qtwayland-everywhere-opensource-src-5.15.15.tar.xz diff --git a/SOURCES/0001-Client-Announce-an-output-after-receiving-more-compl.patch b/SOURCES/0001-Client-Announce-an-output-after-receiving-more-compl.patch index 2142e9d..989ddea 100644 --- a/SOURCES/0001-Client-Announce-an-output-after-receiving-more-compl.patch +++ b/SOURCES/0001-Client-Announce-an-output-after-receiving-more-compl.patch @@ -1,7 +1,7 @@ -From 4ddf70b1ed7c5baddef41c549d04917b9dec7d0f Mon Sep 17 00:00:00 2001 +From e65e194a3d157d5d7c265eacfa374a8b32ff97c1 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 5 May 2021 20:49:26 +0300 -Subject: [PATCH 01/55] Client: Announce an output after receiving more +Subject: [PATCH 01/59] Client: Announce an output after receiving more complete state Output initialization is not atomic, meaning that the compositor may @@ -142,5 +142,5 @@ index df1c94f2..050cfdc0 100644 #if QT_CONFIG(cursor) -- -2.40.0 +2.46.0 diff --git a/SOURCES/0002-Fix-issue-with-repeated-window-size-changes.patch b/SOURCES/0002-Fix-issue-with-repeated-window-size-changes.patch index 58b41d1..1420e4f 100644 --- a/SOURCES/0002-Fix-issue-with-repeated-window-size-changes.patch +++ b/SOURCES/0002-Fix-issue-with-repeated-window-size-changes.patch @@ -1,7 +1,7 @@ -From a9bcc5dc553b5a307a5bdcb6e1d92058e0257c7c Mon Sep 17 00:00:00 2001 +From 9202e23a12f9be24f275e88d385f91534bfe3c33 Mon Sep 17 00:00:00 2001 From: Jaeyoon Jung Date: Mon, 15 Feb 2021 08:31:06 +0900 -Subject: [PATCH 02/55] Fix issue with repeated window size changes +Subject: [PATCH 02/59] Fix issue with repeated window size changes Check if the new window size is different from the size requested previously before calling wl_egl_window_resize. It addresses the issue @@ -20,7 +20,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp -index 57d4eb6b..13dd747a 100644 +index e00c28c3..64f7caeb 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -122,14 +122,16 @@ void QWaylandEglWindow::updateSurface(bool create) @@ -42,10 +42,10 @@ index 57d4eb6b..13dd747a 100644 if (!m_eglSurface && m_waylandEglWindow && create) { diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h -index 6c8f04ec..94c56325 100644 +index 2fccbcea..ad1e5ee9 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h -@@ -87,6 +87,7 @@ private: +@@ -85,6 +85,7 @@ private: mutable QOpenGLFramebufferObject *m_contentFBO = nullptr; QSurfaceFormat m_format; @@ -54,5 +54,5 @@ index 6c8f04ec..94c56325 100644 } -- -2.40.0 +2.46.0 diff --git a/SOURCES/0003-Client-Connect-drags-being-accepted-to-updating-the-.patch b/SOURCES/0003-Client-Connect-drags-being-accepted-to-updating-the-.patch index 80f81ae..3c36275 100644 --- a/SOURCES/0003-Client-Connect-drags-being-accepted-to-updating-the-.patch +++ b/SOURCES/0003-Client-Connect-drags-being-accepted-to-updating-the-.patch @@ -1,7 +1,7 @@ -From eb8e933841d66f0ebe071a170a9af995c2b07b0d Mon Sep 17 00:00:00 2001 +From 2e2a8d2b20c36134db66e50f66b518e75f5a5f7f Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 9 Feb 2021 16:09:21 +0000 -Subject: [PATCH 03/55] Client: Connect drags being accepted to updating the +Subject: [PATCH 03/59] Client: Connect drags being accepted to updating the source drag icon Currently in a multi-process drag and drop when the other client accepts @@ -23,7 +23,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 1 file changed, 1 insertion(+) diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp -index 7e2e3308..bbd2d568 100644 +index 1e2db786..0124b890 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -124,6 +124,7 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, QWaylandWindow *icon) @@ -35,5 +35,5 @@ index 7e2e3308..bbd2d568 100644 start_drag(m_dragSource->object(), origin->wlSurface(), icon->wlSurface(), m_display->currentInputDevice()->serial()); return true; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0004-Client-Disconnect-registry-listener-on-destruction.patch b/SOURCES/0004-Client-Disconnect-registry-listener-on-destruction.patch index 51b5718..01fdd03 100644 --- a/SOURCES/0004-Client-Disconnect-registry-listener-on-destruction.patch +++ b/SOURCES/0004-Client-Disconnect-registry-listener-on-destruction.patch @@ -1,7 +1,7 @@ -From 9d16197f5e888b68cdf98165f46dcc9ac4dd9820 Mon Sep 17 00:00:00 2001 +From bd961fbbb11e00dff46b2dd08aba255fcc2b5068 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 14 May 2021 13:23:24 +0100 -Subject: [PATCH 04/55] Client: Disconnect registry listener on destruction +Subject: [PATCH 04/59] Client: Disconnect registry listener on destruction If a display outlives a QWaylandClientExtension and a new global is announced we end up delivering an event to a now deleted extension which @@ -15,7 +15,7 @@ Change-Id: Idc0de40be61a2f7627ab4963e1fe29b22fbf3f04 2 files changed, 8 insertions(+) diff --git a/src/client/global/qwaylandclientextension.cpp b/src/client/global/qwaylandclientextension.cpp -index 125b1e19..797b06fe 100644 +index 966096a8..2dc61b77 100644 --- a/src/client/global/qwaylandclientextension.cpp +++ b/src/client/global/qwaylandclientextension.cpp @@ -88,6 +88,13 @@ QWaylandClientExtension::QWaylandClientExtension(const int ver) @@ -45,5 +45,5 @@ index 98272e57..5bd28398 100644 QtWaylandClient::QWaylandIntegration *integration() const; int version() const; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0005-Client-Set-XdgShell-size-hints-before-the-first-comm.patch b/SOURCES/0005-Client-Set-XdgShell-size-hints-before-the-first-comm.patch index e77a833..63851ab 100644 --- a/SOURCES/0005-Client-Set-XdgShell-size-hints-before-the-first-comm.patch +++ b/SOURCES/0005-Client-Set-XdgShell-size-hints-before-the-first-comm.patch @@ -1,7 +1,7 @@ -From 8256c6d8bb0f456ad27031bad1cce916c0c29740 Mon Sep 17 00:00:00 2001 +From 16074a6a5da33b12bd16d3630b6cd98ea3d6df6d Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 3 May 2021 23:01:53 +0100 -Subject: [PATCH 05/55] Client: Set XdgShell size hints before the first commit +Subject: [PATCH 05/59] Client: Set XdgShell size hints before the first commit propagateSizeHints is only called in QWindow we have platform window and minimumSizeHint is then sent. We also need to send existing hints when @@ -20,7 +20,7 @@ Reviewed-by: Aleix Pol Gonzalez 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index f50e1c0e..1f51562b 100644 +index 49e9d953..a4811b08 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -105,8 +105,6 @@ void QWaylandXdgSurface::Toplevel::applyConfigure() @@ -32,7 +32,7 @@ index f50e1c0e..1f51562b 100644 m_applied = m_pending; qCDebug(lcQpaWayland) << "Applied pending xdg_toplevel configure event:" << m_applied.size << m_applied.states; } -@@ -257,6 +255,7 @@ QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *shell, ::xdg_surface *s +@@ -267,6 +265,7 @@ QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *shell, ::xdg_surface *s m_toplevel->set_parent(parentXdgSurface->m_toplevel->object()); } } @@ -41,7 +41,7 @@ index f50e1c0e..1f51562b 100644 QWaylandXdgSurface::~QWaylandXdgSurface() diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp -index 2277bbb8..2fdd0a7c 100644 +index 1c23728b..1423d647 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -505,7 +505,7 @@ void tst_xdgshell::minMaxSize() @@ -54,5 +54,5 @@ index 2277bbb8..2fdd0a7c 100644 QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(100, 100)); QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(1000, 1000)); -- -2.40.0 +2.46.0 diff --git a/SOURCES/0006-Fix-build.patch b/SOURCES/0006-Fix-build.patch index 41ba119..98a0125 100644 --- a/SOURCES/0006-Fix-build.patch +++ b/SOURCES/0006-Fix-build.patch @@ -1,7 +1,7 @@ -From bea02a7b4bce8cc3b2a7bce10c53fccc9aedef1e Mon Sep 17 00:00:00 2001 +From 5362f7651857857294cc3882bda6c043699fc9bb Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 14 Jun 2021 12:45:37 +0100 -Subject: [PATCH 06/55] Fix build +Subject: [PATCH 06/59] Fix build 1b5e43a593e917610e6245f7a272ac081c508ba4 relied on a patch that we can't backport. @@ -14,7 +14,7 @@ d6ac8cf6. 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/global/qwaylandclientextension.cpp b/src/client/global/qwaylandclientextension.cpp -index 797b06fe..edccfe63 100644 +index 2dc61b77..36609c08 100644 --- a/src/client/global/qwaylandclientextension.cpp +++ b/src/client/global/qwaylandclientextension.cpp @@ -74,7 +74,10 @@ void QWaylandClientExtensionPrivate::handleRegistryGlobal(void *data, ::wl_regis @@ -42,5 +42,5 @@ index 69cc46a0..9091efbe 100644 class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionTemplatePrivate : public QWaylandClientExtensionPrivate -- -2.40.0 +2.46.0 diff --git a/SOURCES/0007-Fix-remove-listener.patch b/SOURCES/0007-Fix-remove-listener.patch index 958c895..eabb431 100644 --- a/SOURCES/0007-Fix-remove-listener.patch +++ b/SOURCES/0007-Fix-remove-listener.patch @@ -1,7 +1,7 @@ -From 418580420c34c1a81fd5a4d872e41dc467c124d0 Mon Sep 17 00:00:00 2001 +From 6ab275a36f59f885d8e388d85f319efbf451d02f Mon Sep 17 00:00:00 2001 From: Zhang Liang Date: Mon, 1 Feb 2021 19:29:43 +0800 -Subject: [PATCH 07/55] Fix: remove listener +Subject: [PATCH 07/59] Fix: remove listener Add the operation for removing the listener form listener list @@ -13,7 +13,7 @@ Reviewed-by: David Edmundson 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index 78e387bc..280e63bd 100644 +index 8a6d5db1..16f8ca1a 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -456,9 +456,10 @@ void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data) @@ -29,5 +29,5 @@ index 78e387bc..280e63bd 100644 uint32_t QWaylandDisplay::currentTimeMillisec() -- -2.40.0 +2.46.0 diff --git a/SOURCES/0008-Hook-up-queryKeyboardModifers.patch b/SOURCES/0008-Hook-up-queryKeyboardModifers.patch index c121bf4..8723356 100644 --- a/SOURCES/0008-Hook-up-queryKeyboardModifers.patch +++ b/SOURCES/0008-Hook-up-queryKeyboardModifers.patch @@ -1,7 +1,7 @@ -From 0bd8b57955c74fd7cadc3ceb1409c1705208f91e Mon Sep 17 00:00:00 2001 +From 77f82d26ec8025b272a7cf2611454f9d106e55f9 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Wed, 26 May 2021 14:49:40 +0200 -Subject: [PATCH 08/55] Hook up queryKeyboardModifers +Subject: [PATCH 08/59] Hook up queryKeyboardModifers Can be useful when upon enter a modifiers event is received but no key event so no QKeyEvent is generated. @@ -51,5 +51,5 @@ index ff70ae25..73b80658 100644 QStringList themeNames() const override; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0009-Correctly-detect-if-image-format-is-supported-by-QIm.patch b/SOURCES/0009-Correctly-detect-if-image-format-is-supported-by-QIm.patch index 674bde0..83fc028 100644 --- a/SOURCES/0009-Correctly-detect-if-image-format-is-supported-by-QIm.patch +++ b/SOURCES/0009-Correctly-detect-if-image-format-is-supported-by-QIm.patch @@ -1,7 +1,7 @@ -From 046a799372b78ab843b26c2312bb563c0d50adcb Mon Sep 17 00:00:00 2001 +From c3ea1a07fda2579ab7285532679eed4fb346265d Mon Sep 17 00:00:00 2001 From: Jan Blackquill Date: Tue, 24 Aug 2021 14:36:34 -0400 -Subject: [PATCH 09/55] Correctly detect if image format is supported by +Subject: [PATCH 09/59] Correctly detect if image format is supported by QImageWriter The code queries potential image formats by stripping a mimetype of its @@ -51,7 +51,7 @@ Reviewed-by: Qt CI Bot 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qwaylandmimehelper.cpp b/src/shared/qwaylandmimehelper.cpp -index a5fdd34d..051a91dc 100644 +index c5266ab3..e2fe1928 100644 --- a/src/shared/qwaylandmimehelper.cpp +++ b/src/shared/qwaylandmimehelper.cpp @@ -60,7 +60,7 @@ QByteArray QWaylandMimeHelper::getByteArray(QMimeData *mimeData, const QString & @@ -64,5 +64,5 @@ index a5fdd34d..051a91dc 100644 fmt = imgFmt; } -- -2.40.0 +2.46.0 diff --git a/SOURCES/0010-Client-Don-t-always-recreate-frame-callbacks.patch b/SOURCES/0010-Client-Don-t-always-recreate-frame-callbacks.patch index bfe00e5..28a16fa 100644 --- a/SOURCES/0010-Client-Don-t-always-recreate-frame-callbacks.patch +++ b/SOURCES/0010-Client-Don-t-always-recreate-frame-callbacks.patch @@ -1,7 +1,7 @@ -From 3bb880d6b828f934f69608af958963c9eedc4e74 Mon Sep 17 00:00:00 2001 +From 8bb1b5e9a95a0013bf5ab3fb3192d7917c7e6a65 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 27 May 2021 19:55:04 -0300 -Subject: [PATCH 10/55] Client: Don't always recreate frame callbacks +Subject: [PATCH 10/59] Client: Don't always recreate frame callbacks The main QWaylandWindow method that is executed when handling updates is QWaylandWindow::handleUpdate(). This method always, unconditionally queues @@ -38,10 +38,10 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 2 files changed, 6 insertions(+) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index df2dcdaa..23816895 100644 +index d57094a7..9de284de 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp -@@ -1192,6 +1192,10 @@ void QWaylandWindow::requestUpdate() +@@ -1199,6 +1199,10 @@ void QWaylandWindow::requestUpdate() void QWaylandWindow::handleUpdate() { qCDebug(lcWaylandBackingstore) << "handleUpdate" << QThread::currentThread(); @@ -53,7 +53,7 @@ index df2dcdaa..23816895 100644 QReadLocker lock(&mSurfaceLock); if (!mSurface) diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp -index 2fdd0a7c..e2593314 100644 +index 1423d647..46f07c0a 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -138,6 +138,7 @@ void tst_xdgshell::configureSize() @@ -73,5 +73,5 @@ index 2fdd0a7c..e2593314 100644 void tst_xdgshell::popup() -- -2.40.0 +2.46.0 diff --git a/SOURCES/0011-Client-Always-destroy-frame-callback-in-the-actual-c.patch b/SOURCES/0011-Client-Always-destroy-frame-callback-in-the-actual-c.patch index 6eb5579..47e4c6f 100644 --- a/SOURCES/0011-Client-Always-destroy-frame-callback-in-the-actual-c.patch +++ b/SOURCES/0011-Client-Always-destroy-frame-callback-in-the-actual-c.patch @@ -1,7 +1,7 @@ -From a0ab21120ae0d0976d1c554aa72f00d4b3d35de9 Mon Sep 17 00:00:00 2001 +From 32a53f406df6b324516b3244ba9966559c9f10ac Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 27 May 2021 20:02:53 -0300 -Subject: [PATCH 11/55] Client: Always destroy frame callback in the actual +Subject: [PATCH 11/59] Client: Always destroy frame callback in the actual callback It's good hygiene to destroy all frame callbacks. Destroy the @@ -23,7 +23,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 23816895..d3f28d68 100644 +index 9de284de..e0093013 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -635,9 +635,13 @@ void QWaylandWindow::commit() @@ -41,7 +41,7 @@ index 23816895..d3f28d68 100644 window->handleFrameCallback(); } }; -@@ -1201,11 +1205,6 @@ void QWaylandWindow::handleUpdate() +@@ -1208,11 +1212,6 @@ void QWaylandWindow::handleUpdate() if (!mSurface) return; @@ -54,5 +54,5 @@ index 23816895..d3f28d68 100644 struct ::wl_surface *wrappedSurface = reinterpret_cast(wl_proxy_create_wrapper(mSurface->object())); wl_proxy_set_queue(reinterpret_cast(wrappedSurface), mFrameQueue.queue); -- -2.40.0 +2.46.0 diff --git a/SOURCES/0012-Wayland-client-use-wl_keyboard-to-determine-active-s.patch b/SOURCES/0012-Wayland-client-use-wl_keyboard-to-determine-active-s.patch index 1a0cff0..3602591 100644 --- a/SOURCES/0012-Wayland-client-use-wl_keyboard-to-determine-active-s.patch +++ b/SOURCES/0012-Wayland-client-use-wl_keyboard-to-determine-active-s.patch @@ -1,7 +1,7 @@ -From d40acfcc33ae9f8d105f196d1af03a640a02db0b Mon Sep 17 00:00:00 2001 +From 274dfaca7697308a1189fb980627bef10701ce72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9ven=20Car?= Date: Wed, 18 Aug 2021 18:28:20 +0200 -Subject: [PATCH 12/55] Wayland client: use wl_keyboard to determine active +Subject: [PATCH 12/59] Wayland client: use wl_keyboard to determine active state Commit f497a5bb87270174b8e0106b7eca1992d44ff15d made QWaylandDisplay @@ -46,7 +46,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 13 files changed, 39 insertions(+), 66 deletions(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index 280e63bd..1568052e 100644 +index 16f8ca1a..d1ca0274 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -579,14 +579,10 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic @@ -95,7 +95,7 @@ index 1bad8b67..15104d65 100644 void blockingReadEvents(); void flushRequests(); diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index d3f28d68..b363c352 100644 +index e0093013..bba43a54 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -96,7 +96,6 @@ QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display) @@ -115,7 +115,7 @@ index d3f28d68..b363c352 100644 } QWaylandWindow *QWaylandWindow::fromWlSurface(::wl_surface *surface) -@@ -1105,10 +1106,18 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab) +@@ -1112,10 +1113,18 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab) return true; } @@ -234,7 +234,7 @@ index 261f8cbb..c1bcd5c6 100644 private: QScopedPointer m_xdgShell; diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index 1f51562b..b7383e19 100644 +index a4811b08..b57b2c35 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -67,11 +67,6 @@ QWaylandXdgSurface::Toplevel::Toplevel(QWaylandXdgSurface *xdgSurface) @@ -309,7 +309,7 @@ index b6caa6c9..2f929f98 100644 private: QScopedPointer m_xdgShell; diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp -index e2593314..73d1eb9c 100644 +index 46f07c0a..1da70ff2 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -31,6 +31,7 @@ @@ -335,7 +335,7 @@ index e2593314..73d1eb9c 100644 + Qt::WindowActive)); // Just make sure it eventually get's set correctly const QSize screenSize(640, 480); - const uint maximizedSerial = exec([=] { + const uint maximizedSerial = exec([&] { -- -2.40.0 +2.46.0 diff --git a/SOURCES/0013-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch b/SOURCES/0013-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch index fb12a01..c5eb6f5 100644 --- a/SOURCES/0013-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch +++ b/SOURCES/0013-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch @@ -1,7 +1,7 @@ -From 23327bb4cdc00b47e0f96efca2fe494540f01601 Mon Sep 17 00:00:00 2001 +From 21104e57db0aece854f59da13579186e6b52711a Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Fri, 16 Jul 2021 13:00:03 +0200 -Subject: [PATCH 13/55] Client: do not empty clipboard when a new popup/window +Subject: [PATCH 13/59] Client: do not empty clipboard when a new popup/window is opened If we open a new popup or a window within the same app we have to avoid @@ -21,7 +21,7 @@ Cherry-pick: 1e57ebd501cfc2255300392cd4565cd034efeed8 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index 1568052e..aa8808e9 100644 +index d1ca0274..7560bf41 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -601,6 +601,19 @@ void QWaylandDisplay::handleWaylandSync() @@ -45,10 +45,10 @@ index 1568052e..aa8808e9 100644 const wl_callback_listener QWaylandDisplay::syncCallbackListener = { diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp -index e931d1f5..5d704795 100644 +index 5bd51385..988d51af 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp -@@ -1304,14 +1304,6 @@ void QWaylandInputDevice::Keyboard::handleFocusDestroyed() +@@ -1309,14 +1309,6 @@ void QWaylandInputDevice::Keyboard::handleFocusDestroyed() void QWaylandInputDevice::Keyboard::handleFocusLost() { mFocus = nullptr; @@ -64,5 +64,5 @@ index e931d1f5..5d704795 100644 mRepeatTimer.stop(); } -- -2.40.0 +2.46.0 diff --git a/SOURCES/0014-Client-Implement-DataDeviceV3.patch b/SOURCES/0014-Client-Implement-DataDeviceV3.patch index 76c63d1..fcdbe58 100644 --- a/SOURCES/0014-Client-Implement-DataDeviceV3.patch +++ b/SOURCES/0014-Client-Implement-DataDeviceV3.patch @@ -1,7 +1,7 @@ -From e0e004c77140da5e454dadf4d6809c1603b5735d Mon Sep 17 00:00:00 2001 +From e0f612dcae95df15c60e4b4684f6dbcd8095152c Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 16 Feb 2021 09:51:47 +0000 -Subject: [PATCH 14/55] Client: Implement DataDeviceV3 +Subject: [PATCH 14/59] Client: Implement DataDeviceV3 DataDeviceV2 fixes a leak of DataDevice resources. @@ -36,7 +36,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 12 files changed, 153 insertions(+), 46 deletions(-) diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp -index bbd2d568..fbb5aa91 100644 +index 0124b890..d154c695 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -72,6 +72,8 @@ QWaylandDataDevice::QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWayl @@ -340,10 +340,10 @@ index 9cf1483c..6f667398 100644 diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp -index f45122fb..5599cbd4 100644 +index c86c1416..321170a6 100644 --- a/src/client/qwaylanddatasource.cpp +++ b/src/client/qwaylanddatasource.cpp -@@ -101,7 +101,32 @@ void QWaylandDataSource::data_source_send(const QString &mime_type, int32_t fd) +@@ -105,7 +105,32 @@ void QWaylandDataSource::data_source_send(const QString &mime_type, int32_t fd) void QWaylandDataSource::data_source_target(const QString &mime_type) { @@ -378,11 +378,11 @@ index f45122fb..5599cbd4 100644 } diff --git a/src/client/qwaylanddatasource_p.h b/src/client/qwaylanddatasource_p.h -index 25afff79..96f07bc3 100644 +index 520b3165..089c5485 100644 --- a/src/client/qwaylanddatasource_p.h +++ b/src/client/qwaylanddatasource_p.h -@@ -77,17 +77,25 @@ public: - QMimeData *mimeData() const; +@@ -75,16 +75,24 @@ public: + ~QWaylandDataSource() override; Q_SIGNALS: - void targetChanged(const QString &mime_type); @@ -401,7 +401,6 @@ index 25afff79..96f07bc3 100644 + void data_source_action(uint32_t action) override; private: - QWaylandDisplay *m_display = nullptr; QMimeData *m_mime_data = nullptr; + bool m_accepted = false; + Qt::DropAction m_dropAction = Qt::IgnoreAction; @@ -409,7 +408,7 @@ index 25afff79..96f07bc3 100644 } diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index aa8808e9..2d298532 100644 +index 7560bf41..7f28d01c 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -356,7 +356,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin @@ -509,5 +508,5 @@ index 1568b3b9..067410d0 100644 class DataDeviceCompositor : public DefaultCompositor { public: -- -2.40.0 +2.46.0 diff --git a/SOURCES/0015-Client-Delay-deletion-of-QDrag-object-until-after-we.patch b/SOURCES/0015-Client-Delay-deletion-of-QDrag-object-until-after-we.patch index a07907b..055174f 100644 --- a/SOURCES/0015-Client-Delay-deletion-of-QDrag-object-until-after-we.patch +++ b/SOURCES/0015-Client-Delay-deletion-of-QDrag-object-until-after-we.patch @@ -1,7 +1,7 @@ -From f3900786ebe46aefbecbb2a37cb175846ca0dfc2 Mon Sep 17 00:00:00 2001 +From f3c9926d5c0735fe9514240b3eb6be781b4bacd0 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 18 Nov 2021 13:05:30 +0100 -Subject: [PATCH 15/55] Client: Delay deletion of QDrag object until after +Subject: [PATCH 15/59] Client: Delay deletion of QDrag object until after we're done with it In certain cases, most notably when performing drag and drop operations @@ -63,5 +63,5 @@ index 747f0190..46f629ac 100644 private: QWaylandDisplay *m_display = nullptr; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0016-Client-Avoid-processing-of-events-when-showing-windo.patch b/SOURCES/0016-Client-Avoid-processing-of-events-when-showing-windo.patch index de9483c..4d97983 100644 --- a/SOURCES/0016-Client-Avoid-processing-of-events-when-showing-windo.patch +++ b/SOURCES/0016-Client-Avoid-processing-of-events-when-showing-windo.patch @@ -1,7 +1,7 @@ -From 9edd2a05c79a1c40867440826c830c76136152da Mon Sep 17 00:00:00 2001 +From 9cafe8145f1d1750a4c06c802266c8bbf9dba049 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Sun, 14 Nov 2021 13:54:19 +0000 -Subject: [PATCH 16/55] Client: Avoid processing of events when showing windows +Subject: [PATCH 16/59] Client: Avoid processing of events when showing windows The only time we want to dispatch events from the wayland socket is when the application is waiting for external events. Doing so at any other @@ -22,7 +22,7 @@ Reviewed-by: Aleix Pol Gonzalez 1 file changed, 1 deletion(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index b363c352..b98435ed 100644 +index bba43a54..41e56d24 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -437,7 +437,6 @@ void QWaylandWindow::setVisible(bool visible) @@ -34,5 +34,5 @@ index b363c352..b98435ed 100644 setGeometry(windowGeometry()); // Don't flush the events here, or else the newly visible window may start drawing, but since -- -2.40.0 +2.46.0 diff --git a/SOURCES/0017-Handle-registry_global-out-of-constructor.patch b/SOURCES/0017-Handle-registry_global-out-of-constructor.patch index 96206d3..17fa3e6 100644 --- a/SOURCES/0017-Handle-registry_global-out-of-constructor.patch +++ b/SOURCES/0017-Handle-registry_global-out-of-constructor.patch @@ -1,7 +1,7 @@ -From 5889bb845d951a7877201bca97ffe4bb2491d966 Mon Sep 17 00:00:00 2001 +From ce109ee9807512825f568a8c480c2334ffd2a8e0 Mon Sep 17 00:00:00 2001 From: Elvis Lee Date: Thu, 18 Feb 2021 15:45:49 +0900 -Subject: [PATCH 17/55] Handle registry_global out of constructor +Subject: [PATCH 17/59] Handle registry_global out of constructor Factory functions in QWaylandDisplay::registry_global() can be overridden. Later, other classes instantiated in the registry_global can support @@ -17,7 +17,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index 2d298532..97fb8cbe 100644 +index 7f28d01c..c2482030 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -160,13 +160,6 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) @@ -81,5 +81,5 @@ index cd8569b1..8afecb31 100644 mDisplay->ensureScreen(); } -- -2.40.0 +2.46.0 diff --git a/SOURCES/0018-Connect-flushRequest-after-forceRoundTrip.patch b/SOURCES/0018-Connect-flushRequest-after-forceRoundTrip.patch index 3b9af70..2644cec 100644 --- a/SOURCES/0018-Connect-flushRequest-after-forceRoundTrip.patch +++ b/SOURCES/0018-Connect-flushRequest-after-forceRoundTrip.patch @@ -1,7 +1,7 @@ -From 2e03c3b47fa91eb8db5b9a635c2f9dca2b4f5158 Mon Sep 17 00:00:00 2001 +From 74b2f90d79ba98efc8d7f5d83c8ec3460c90817d Mon Sep 17 00:00:00 2001 From: Elvis Lee Date: Wed, 17 Mar 2021 16:31:10 +0900 -Subject: [PATCH 18/55] Connect flushRequest after forceRoundTrip +Subject: [PATCH 18/59] Connect flushRequest after forceRoundTrip If flushRequest is connected with aboutToBlock, the flushRequest may consumes all events so that processEvents might be blocked in forceRoundTrip. @@ -43,5 +43,5 @@ index 8afecb31..661cea53 100644 mDisplay->ensureScreen(); } -- -2.40.0 +2.46.0 diff --git a/SOURCES/0019-Move-the-wayland-socket-polling-to-a-separate-event-.patch b/SOURCES/0019-Move-the-wayland-socket-polling-to-a-separate-event-.patch index 5e045bf..d987e2f 100644 --- a/SOURCES/0019-Move-the-wayland-socket-polling-to-a-separate-event-.patch +++ b/SOURCES/0019-Move-the-wayland-socket-polling-to-a-separate-event-.patch @@ -1,7 +1,7 @@ -From d89cc9deab3f61cacfad71e8aa32d83d421d49da Mon Sep 17 00:00:00 2001 +From 2e579f2d19d81bcfc01a1f8e9fa90cadec3c67f6 Mon Sep 17 00:00:00 2001 From: Adrien Faveraux Date: Fri, 26 Nov 2021 09:18:58 +0100 -Subject: [PATCH 19/55] Move the wayland socket polling to a separate event +Subject: [PATCH 19/59] Move the wayland socket polling to a separate event thread New event threads is introduced which calls poll() on the wayland fd, @@ -32,7 +32,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 5 files changed, 255 insertions(+), 108 deletions(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index 97fb8cbe..ebcdbd22 100644 +index c2482030..c38f6f82 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -87,10 +87,203 @@ @@ -371,13 +371,15 @@ index 97fb8cbe..ebcdbd22 100644 } QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const -@@ -678,4 +816,6 @@ QWaylandCursorTheme *QWaylandDisplay::loadCursorTheme(const QString &name, int p +@@ -678,6 +816,8 @@ QWaylandCursorTheme *QWaylandDisplay::loadCursorTheme(const QString &name, int p } // namespace QtWaylandClient +#include "qwaylanddisplay.moc" + QT_END_NAMESPACE + + #include "moc_qwaylanddisplay_p.cpp" diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 49820255..cf91b924 100644 --- a/src/client/qwaylanddisplay_p.h @@ -458,7 +460,7 @@ index 661cea53..fbf00c6b 100644 // Call after eventDispatcher is fully connected, for QWaylandDisplay::forceRoundTrip() mDisplay->initialize(); diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index b98435ed..292dd023 100644 +index 41e56d24..a38f7d55 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -76,7 +76,6 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr; @@ -506,7 +508,7 @@ index b98435ed..292dd023 100644 if (mWaitingForFrameCallback) { qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed"; -@@ -1179,8 +1182,11 @@ void QWaylandWindow::requestUpdate() +@@ -1186,8 +1189,11 @@ void QWaylandWindow::requestUpdate() Q_ASSERT(hasPendingUpdateRequest()); // should be set by QPA // If we have a frame callback all is good and will be taken care of there @@ -520,7 +522,7 @@ index b98435ed..292dd023 100644 // If we've already called deliverUpdateRequest(), but haven't seen any attach+commit/swap yet // This is a somewhat redundant behavior and might indicate a bug in the calling code, so log -@@ -1193,7 +1199,12 @@ void QWaylandWindow::requestUpdate() +@@ -1200,7 +1206,12 @@ void QWaylandWindow::requestUpdate() // so use invokeMethod to delay the delivery a bit. QMetaObject::invokeMethod(this, [this] { // Things might have changed in the meantime @@ -534,7 +536,7 @@ index b98435ed..292dd023 100644 deliverUpdateRequest(); }, Qt::QueuedConnection); } -@@ -1213,9 +1224,10 @@ void QWaylandWindow::handleUpdate() +@@ -1220,9 +1231,10 @@ void QWaylandWindow::handleUpdate() if (!mSurface) return; @@ -547,7 +549,7 @@ index b98435ed..292dd023 100644 mFrameCallback = wl_surface_frame(wrappedSurface); wl_proxy_wrapper_destroy(wrappedSurface); wl_callback_add_listener(mFrameCallback, &QWaylandWindow::callbackListener, this); -@@ -1225,6 +1237,8 @@ void QWaylandWindow::handleUpdate() +@@ -1232,6 +1244,8 @@ void QWaylandWindow::handleUpdate() // Start a timer for handling the case when the compositor stops sending frame callbacks. if (mFrameCallbackTimeout > 0) { QMetaObject::invokeMethod(this, [this] { @@ -570,5 +572,5 @@ index fb3ed606..54ac67a9 100644 // True when we have called deliverRequestUpdate, but the client has not yet attached a new buffer -- -2.40.0 +2.46.0 diff --git a/SOURCES/0020-Client-Remove-mWaitingForUpdateDelivery.patch b/SOURCES/0020-Client-Remove-mWaitingForUpdateDelivery.patch index 3074807..3fb2351 100644 --- a/SOURCES/0020-Client-Remove-mWaitingForUpdateDelivery.patch +++ b/SOURCES/0020-Client-Remove-mWaitingForUpdateDelivery.patch @@ -1,7 +1,7 @@ -From 58c67c6e8f2d94cef7f8eec072ebad031769e144 Mon Sep 17 00:00:00 2001 +From 6f85585ae2850bfbe8c995e22dee42d02b619b81 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 1 Feb 2022 13:05:36 +0200 -Subject: [PATCH 20/55] Client: Remove mWaitingForUpdateDelivery +Subject: [PATCH 20/59] Client: Remove mWaitingForUpdateDelivery Currently, mWaitingForUpdateDelivery is shared between the main thread (doHandleFrameCallback()) and the frame callback event thread @@ -23,7 +23,7 @@ Reviewed-by: David Edmundson 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 292dd023..de5af1bd 100644 +index a38f7d55..6bf0fc4b 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -651,23 +651,18 @@ void QWaylandWindow::handleFrameCallback() @@ -75,5 +75,5 @@ index 54ac67a9..cf7ce879 100644 QElapsedTimer mFrameCallbackElapsedTimer; struct ::wl_callback *mFrameCallback = nullptr; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0021-client-Simplify-round-trip-behavior.patch b/SOURCES/0021-client-Simplify-round-trip-behavior.patch index b6b1d10..92ffa93 100644 --- a/SOURCES/0021-client-Simplify-round-trip-behavior.patch +++ b/SOURCES/0021-client-Simplify-round-trip-behavior.patch @@ -1,7 +1,7 @@ -From 71a1a9791df20307dd4eb688b0957d0f695823c5 Mon Sep 17 00:00:00 2001 +From 8e83212c000dfa139da3fb0fa97cb639eee4a4ae Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 9 Feb 2022 17:20:48 +0000 -Subject: [PATCH 21/55] client: Simplify round trip behavior +Subject: [PATCH 21/59] client: Simplify round trip behavior The custom event queue was removed in 302d4ffb8549214eb4028dc3e47ec4ee4e12ffbd (2015) so the comment about not @@ -22,7 +22,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index ebcdbd22..d371ffec 100644 +index c38f6f82..b8da02b3 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -615,50 +615,9 @@ uint32_t QWaylandDisplay::currentTimeMillisec() @@ -78,5 +78,5 @@ index ebcdbd22..d371ffec 100644 bool QWaylandDisplay::supportsWindowDecoration() const -- -2.40.0 +2.46.0 diff --git a/SOURCES/0022-Client-Fix-opaque-region-setter.patch b/SOURCES/0022-Client-Fix-opaque-region-setter.patch index 6c6c41d..4379353 100644 --- a/SOURCES/0022-Client-Fix-opaque-region-setter.patch +++ b/SOURCES/0022-Client-Fix-opaque-region-setter.patch @@ -1,7 +1,7 @@ -From f584a8350503e349669744a1587634431ac0dc82 Mon Sep 17 00:00:00 2001 +From c2fb3ac8ef48bcc508beb30e6d5869d7fd69ea44 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sat, 19 Feb 2022 17:01:04 +0200 -Subject: [PATCH 22/55] Client: Fix opaque region setter +Subject: [PATCH 22/59] Client: Fix opaque region setter The rect is in the global coordinate system, while the opaque region must be in the surface local coordinate system. @@ -14,7 +14,7 @@ Reviewed-by: Aleix Pol Gonzalez 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index de5af1bd..69319228 100644 +index 6bf0fc4b..9cc8cb12 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -372,7 +372,7 @@ void QWaylandWindow::setGeometry(const QRect &rect) @@ -27,5 +27,5 @@ index de5af1bd..69319228 100644 void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset) -- -2.40.0 +2.46.0 diff --git a/SOURCES/0023-Use-proper-dependencies-in-compile-tests.patch b/SOURCES/0023-Use-proper-dependencies-in-compile-tests.patch index 0023433..27055ef 100644 --- a/SOURCES/0023-Use-proper-dependencies-in-compile-tests.patch +++ b/SOURCES/0023-Use-proper-dependencies-in-compile-tests.patch @@ -1,7 +1,7 @@ -From a9831916ac5463682b7a27db3ffcadfe0ea07ab9 Mon Sep 17 00:00:00 2001 +From 0c93e66a04306e8029302aa9d1e9ca453ef6f184 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Fri, 4 Feb 2022 11:07:36 +0100 -Subject: [PATCH 23/55] Use proper dependencies in compile tests +Subject: [PATCH 23/59] Use proper dependencies in compile tests Use the dependencies as found by the "libraries" section instead of relying on them being available in the default location (e.g. "-ldrm"). @@ -18,25 +18,15 @@ different patch and not a cherry-pick of 5fc2e1915c3a Fixes: QTBUG-100475 --- - src/client/configure.json | 8 ++++---- - src/compositor/configure.json | 34 +++++++++++++++++++++++++++++----- - 2 files changed, 33 insertions(+), 9 deletions(-) + src/client/configure.json | 5 +++-- + src/compositor/configure.json | 28 +++++++++++++++++++++++++++- + 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/client/configure.json b/src/client/configure.json -index 2f424580..29222357 100644 +index 73f23362..6247f85e 100644 --- a/src/client/configure.json +++ b/src/client/configure.json -@@ -149,8 +149,7 @@ - "#endif" - ] - }, -- "libs": "-ldrm", -- "use": "egl" -+ "use": "drm egl" - }, - "vulkan-server-buffer": { - "label": "Vulkan Buffer Sharing", -@@ -168,7 +167,8 @@ +@@ -167,7 +167,8 @@ "exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;", "return 0;" ] @@ -46,7 +36,7 @@ index 2f424580..29222357 100644 }, "egl_1_5-wayland": { "label": "EGL 1.5 with Wayland Platform", -@@ -183,7 +183,7 @@ +@@ -182,7 +183,7 @@ "eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, (struct wl_display *)(nullptr), nullptr);" ] }, @@ -56,7 +46,7 @@ index 2f424580..29222357 100644 }, diff --git a/src/compositor/configure.json b/src/compositor/configure.json -index bcfd5215..da95d07b 100644 +index c5b0f03e..031e4cc3 100644 --- a/src/compositor/configure.json +++ b/src/compositor/configure.json @@ -7,6 +7,31 @@ @@ -91,27 +81,7 @@ index bcfd5215..da95d07b 100644 "wayland-server": { "label": "wayland-server", "headers": "wayland-version.h", -@@ -151,8 +176,7 @@ - "#endif" - ] - }, -- "libs": "-ldrm", -- "use": "egl" -+ "use": "drm egl" - }, - "dmabuf-client-buffer": { - "label": "Linux Client dma-buf Buffer Sharing", -@@ -176,8 +200,7 @@ - "return 0;" - ] - }, -- "libs": "-ldrm", -- "use": "egl" -+ "use": "drm egl" - }, - "vulkan-server-buffer": { - "label": "Vulkan Buffer Sharing", -@@ -195,7 +218,8 @@ +@@ -193,7 +218,8 @@ "exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;", "return 0;" ] @@ -122,5 +92,5 @@ index bcfd5215..da95d07b 100644 }, -- -2.40.0 +2.46.0 diff --git a/SOURCES/0024-Revert-Client-Remove-mWaitingForUpdateDelivery.patch b/SOURCES/0024-Revert-Client-Remove-mWaitingForUpdateDelivery.patch index 1cc3e5c..df932c3 100644 --- a/SOURCES/0024-Revert-Client-Remove-mWaitingForUpdateDelivery.patch +++ b/SOURCES/0024-Revert-Client-Remove-mWaitingForUpdateDelivery.patch @@ -1,7 +1,7 @@ -From c6639e225f45564def8f6729c83887ab73495e59 Mon Sep 17 00:00:00 2001 +From 6c5560860a7df5195a305469592a961b0037cfba Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 15 Mar 2022 15:59:15 +0100 -Subject: [PATCH 24/55] Revert "Client: Remove mWaitingForUpdateDelivery" +Subject: [PATCH 24/59] Revert "Client: Remove mWaitingForUpdateDelivery" The reverted commit introduces a severe performance regression when a client window is resized while a QtQuick renderthread @@ -18,7 +18,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 69319228..a87e11aa 100644 +index 9cc8cb12..3d1be31c 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -658,11 +658,17 @@ void QWaylandWindow::handleFrameCallback() @@ -55,5 +55,5 @@ index cf7ce879..54ac67a9 100644 QElapsedTimer mFrameCallbackElapsedTimer; struct ::wl_callback *mFrameCallback = nullptr; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0025-Fix-race-condition-on-mWaitingForUpdateDelivery.patch b/SOURCES/0025-Fix-race-condition-on-mWaitingForUpdateDelivery.patch index 9f03187..3b8dc95 100644 --- a/SOURCES/0025-Fix-race-condition-on-mWaitingForUpdateDelivery.patch +++ b/SOURCES/0025-Fix-race-condition-on-mWaitingForUpdateDelivery.patch @@ -1,7 +1,7 @@ -From 2c403a8522db9aa6a9f365dba5f8ef5af205295c Mon Sep 17 00:00:00 2001 +From a37909007807b98bf97bf4894fa426438de210a5 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 15 Mar 2022 16:53:04 +0100 -Subject: [PATCH 25/55] Fix race condition on mWaitingForUpdateDelivery +Subject: [PATCH 25/59] Fix race condition on mWaitingForUpdateDelivery Change-Id: I0e91bda73722468b9339fc434fe04420b5e7d3da Reviewed-by: David Edmundson @@ -11,7 +11,7 @@ Reviewed-by: David Edmundson 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index a87e11aa..264ca59b 100644 +index 3d1be31c..014e2d87 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -652,24 +652,21 @@ void QWaylandWindow::handleFrameCallback() @@ -55,5 +55,5 @@ index 54ac67a9..c0a76345 100644 QElapsedTimer mFrameCallbackElapsedTimer; struct ::wl_callback *mFrameCallback = nullptr; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0026-use-poll-2-when-reading-from-clipboard.patch b/SOURCES/0026-use-poll-2-when-reading-from-clipboard.patch index 358dc32..cc2a4bf 100644 --- a/SOURCES/0026-use-poll-2-when-reading-from-clipboard.patch +++ b/SOURCES/0026-use-poll-2-when-reading-from-clipboard.patch @@ -1,7 +1,7 @@ -From 2f0528fc51a378bdd8a3ff93d996765fccf54cce Mon Sep 17 00:00:00 2001 +From 49ab2a01df27d1941f9654da5c7643a149d26854 Mon Sep 17 00:00:00 2001 From: Kenneth Topp Date: Mon, 4 Apr 2022 09:36:21 -0400 -Subject: [PATCH 26/55] use poll(2) when reading from clipboard +Subject: [PATCH 26/59] use poll(2) when reading from clipboard change clipboard read away from select(2) call which can fail when an application has large number of open files @@ -44,5 +44,5 @@ index c9e158cc..fe0ea8c9 100644 } else if (ready == 0) { qWarning("QWaylandDataOffer: timeout reading from pipe"); -- -2.40.0 +2.46.0 diff --git a/SOURCES/0027-Reduce-memory-leakage.patch b/SOURCES/0027-Reduce-memory-leakage.patch index e647362..92bfb28 100644 --- a/SOURCES/0027-Reduce-memory-leakage.patch +++ b/SOURCES/0027-Reduce-memory-leakage.patch @@ -1,7 +1,7 @@ -From 2197557879ae1e3459e715dbc20b21e8652cb972 Mon Sep 17 00:00:00 2001 +From 264c9a77b8f277860a85f76b75864ee627133017 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 22 Feb 2022 12:31:08 +0100 -Subject: [PATCH 27/55] Reduce memory leakage +Subject: [PATCH 27/59] Reduce memory leakage We need to clean up the event queue when we're done. @@ -13,7 +13,7 @@ Reviewed-by: David Edmundson 1 file changed, 3 insertions(+) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index d371ffec..1b9ec699 100644 +index b8da02b3..4a331a4c 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -381,6 +381,9 @@ QWaylandDisplay::~QWaylandDisplay(void) @@ -27,5 +27,5 @@ index d371ffec..1b9ec699 100644 // Steps which is called just after constructor. This separates registry_global() out of the constructor -- -2.40.0 +2.46.0 diff --git a/SOURCES/0028-Fix-build-with-libcxx-missing-array-include.patch b/SOURCES/0028-Fix-build-with-libcxx-missing-array-include.patch deleted file mode 100644 index a731873..0000000 --- a/SOURCES/0028-Fix-build-with-libcxx-missing-array-include.patch +++ /dev/null @@ -1,32 +0,0 @@ -From d9b04ba05ed479b577579e6a34d97fb906791f69 Mon Sep 17 00:00:00 2001 -From: Sam James -Date: Sat, 18 Jun 2022 17:11:11 +0100 -Subject: [PATCH 28/55] Fix build with libcxx (missing array include) - -Bug: https://bugs.gentoo.org/833488 - -Task-number: QTBUG-104435 -Change-Id: I06384761a5560b81b675e6c4ae498bb93dcb4f4f -Pick-to: 5.15 6.2 6.3 6.4 -Reviewed-by: Marc Mutz -(cherry picked from commit 5065013b0c2346b5918a2681ae2e58046140e8a7) ---- - .../compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h -index 56a710c3..c6a8b6c6 100644 ---- a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h -+++ b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h -@@ -41,6 +41,8 @@ - #include - #include - -+#include -+ - #include - #include - --- -2.40.0 - diff --git a/SOURCES/0029-Only-close-popup-in-the-the-hierchary.patch b/SOURCES/0028-Only-close-popup-in-the-the-hierchary.patch similarity index 95% rename from SOURCES/0029-Only-close-popup-in-the-the-hierchary.patch rename to SOURCES/0028-Only-close-popup-in-the-the-hierchary.patch index 7378cfe..47851f0 100644 --- a/SOURCES/0029-Only-close-popup-in-the-the-hierchary.patch +++ b/SOURCES/0028-Only-close-popup-in-the-the-hierchary.patch @@ -1,7 +1,7 @@ -From 9265dae0d87eaf2a0dfc8a67c46f6c11bd14d2ab Mon Sep 17 00:00:00 2001 +From a91e358bcfaa8195dfadd94b5ccd0a5faad9a82b Mon Sep 17 00:00:00 2001 From: Weng Xuetian Date: Wed, 20 Jul 2022 15:57:40 -0700 -Subject: [PATCH 29/55] Only close popup in the the hierchary +Subject: [PATCH 28/59] Only close popup in the the hierchary Imagine following event sequences: 1. a tooltip is shown. activePopups = {tooltip} @@ -31,7 +31,7 @@ Reviewed-by: David Edmundson 9 files changed, 136 insertions(+), 30 deletions(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 264ca59b..9e82c174 100644 +index 014e2d87..1e916ca1 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -239,6 +239,7 @@ bool QWaylandWindow::shouldCreateSubSurface() const @@ -81,7 +81,7 @@ index 264ca59b..9e82c174 100644 reset(); } } -@@ -1297,6 +1280,20 @@ void QWaylandWindow::setOpaqueArea(const QRegion &opaqueArea) +@@ -1304,6 +1287,20 @@ void QWaylandWindow::setOpaqueArea(const QRegion &opaqueArea) wl_region_destroy(region); } @@ -209,7 +209,7 @@ index 8c371661..151c78e3 100644 auto *shell = m_xdgSurface->m_shell; Q_ASSERT(shell->m_topmostGrabbingPopup == this); diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index b7383e19..962001b3 100644 +index b57b2c35..bca8ad83 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -195,12 +195,17 @@ QtWayland::xdg_toplevel::resize_edge QWaylandXdgSurface::Toplevel::convertToResi @@ -246,10 +246,10 @@ index b7383e19..962001b3 100644 Q_ASSERT(shell->m_topmostGrabbingPopup == this); - shell->m_topmostGrabbingPopup = m_parent->m_popup; + shell->m_topmostGrabbingPopup = m_parentXdgSurface ? m_parentXdgSurface->m_popup : nullptr; - } - } + m_grabbing = false; -@@ -393,8 +402,6 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) + // Synthesize Qt enter/leave events for popup +@@ -403,8 +412,6 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) { Q_ASSERT(!m_toplevel && !m_popup); @@ -258,10 +258,10 @@ index b7383e19..962001b3 100644 auto positioner = new QtWayland::xdg_positioner(m_shell->create_positioner()); // set_popup expects a position relative to the parent QPoint transientPos = m_window->geometry().topLeft(); // this is absolute -@@ -411,8 +418,9 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) - | QtWayland::xdg_positioner::constraint_adjustment_slide_y - | QtWayland::xdg_positioner::constraint_adjustment_flip_x - | QtWayland::xdg_positioner::constraint_adjustment_flip_y); +@@ -419,8 +426,9 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) + 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); - m_popup = new Popup(this, parentXdgSurface, positioner); + m_popup = new Popup(this, parent, positioner); positioner->destroy(); @@ -292,7 +292,7 @@ index 96785205..4b518f0a 100644 }; diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp -index 73d1eb9c..747875b4 100644 +index 1da70ff2..c5271f63 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -46,6 +46,7 @@ private slots: @@ -397,5 +397,5 @@ index 73d1eb9c..747875b4 100644 void tst_xdgshell::switchPopups() { -- -2.40.0 +2.46.0 diff --git a/SOURCES/0031-Check-pointer-for-null-before-use-in-ASSERT.patch b/SOURCES/0029-Check-pointer-for-null-before-use-in-ASSERT.patch similarity index 84% rename from SOURCES/0031-Check-pointer-for-null-before-use-in-ASSERT.patch rename to SOURCES/0029-Check-pointer-for-null-before-use-in-ASSERT.patch index c6a4793..888b33c 100644 --- a/SOURCES/0031-Check-pointer-for-null-before-use-in-ASSERT.patch +++ b/SOURCES/0029-Check-pointer-for-null-before-use-in-ASSERT.patch @@ -1,7 +1,7 @@ -From ec0171610350305be51c3e4be7c6f086cb360fe6 Mon Sep 17 00:00:00 2001 +From bb1101f1ba935343ea385fcd3a6a7ea8d08636c4 Mon Sep 17 00:00:00 2001 From: Roman Genkhel Date: Thu, 12 Nov 2020 12:21:51 +0300 -Subject: [PATCH 31/55] Check pointer for null before use in ASSERT +Subject: [PATCH 29/59] Check pointer for null before use in ASSERT Task-number: QTBUG-85195 Change-Id: I331e54f6e58aa9d536351a55223610c60b3cb414 @@ -12,7 +12,7 @@ Reviewed-by: David Edmundson 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 9e82c174..0a5fc15b 100644 +index 1e916ca1..d98a70e4 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -536,12 +536,12 @@ void QWaylandWindow::sendRecursiveExposeEvent() @@ -30,5 +30,5 @@ index 9e82c174..0a5fc15b 100644 buffer->setBusy(); -- -2.40.0 +2.46.0 diff --git a/SOURCES/0030-Build-fixes-for-GCC-11.patch b/SOURCES/0030-Build-fixes-for-GCC-11.patch deleted file mode 100644 index 28ad68d..0000000 --- a/SOURCES/0030-Build-fixes-for-GCC-11.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 08ce7a21017e1f9553cd0f4af1316e38709d5553 Mon Sep 17 00:00:00 2001 -From: Ville Voutilainen -Date: Mon, 18 Jan 2021 12:31:31 +0200 -Subject: [PATCH 30/55] Build fixes for GCC 11 - -Task-number: QTBUG-89977 -Change-Id: I7e3d0964087865e8062f539f851a61f3df017dae -Reviewed-by: David Edmundson -(cherry picked from commit 1aa6ec2c778504d96543f6cdc2b9199a7b066fc1) ---- - tests/auto/client/shared/corecompositor.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tests/auto/client/shared/corecompositor.cpp b/tests/auto/client/shared/corecompositor.cpp -index 5c6c83ba..fa9b7662 100644 ---- a/tests/auto/client/shared/corecompositor.cpp -+++ b/tests/auto/client/shared/corecompositor.cpp -@@ -27,6 +27,7 @@ - ****************************************************************************/ - - #include "corecompositor.h" -+#include - - namespace MockCompositor { - --- -2.40.0 - diff --git a/SOURCES/0032-Use-wl_surface.damage_buffer-on-the-client-side.patch b/SOURCES/0030-Use-wl_surface.damage_buffer-on-the-client-side.patch similarity index 96% rename from SOURCES/0032-Use-wl_surface.damage_buffer-on-the-client-side.patch rename to SOURCES/0030-Use-wl_surface.damage_buffer-on-the-client-side.patch index 5f02727..3156e27 100644 --- a/SOURCES/0032-Use-wl_surface.damage_buffer-on-the-client-side.patch +++ b/SOURCES/0030-Use-wl_surface.damage_buffer-on-the-client-side.patch @@ -1,7 +1,7 @@ -From 2d3d929c86c5aab6dd30e02ade25697d49617335 Mon Sep 17 00:00:00 2001 +From fa3f3172fd12b10c25fc56cce1f85fbd17fa3a5c Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 6 Jul 2020 14:37:35 +0200 -Subject: [PATCH 32/55] Use wl_surface.damage_buffer on the client side +Subject: [PATCH 30/59] Use wl_surface.damage_buffer on the client side Prefer the newer, recommended damage_buffer when the compositor supports it. @@ -20,7 +20,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index 1b9ec699..6898a881 100644 +index 4a331a4c..f23c459d 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -493,7 +493,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin @@ -33,7 +33,7 @@ index 1b9ec699..6898a881 100644 } else if (interface == QStringLiteral("wl_shm")) { mShm.reset(new QWaylandShm(this, version, id)); diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 0a5fc15b..5b7f9df9 100644 +index d98a70e4..60665394 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -563,7 +563,11 @@ void QWaylandWindow::damage(const QRect &rect) @@ -127,5 +127,5 @@ index 949dc23d..d176837e 100644 uint32_t callback) override; void surface_commit(Resource *resource) override; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0033-Client-clear-focus-on-touch-cancel.patch b/SOURCES/0031-Client-clear-focus-on-touch-cancel.patch similarity index 94% rename from SOURCES/0033-Client-clear-focus-on-touch-cancel.patch rename to SOURCES/0031-Client-clear-focus-on-touch-cancel.patch index 7513b34..f9f987e 100644 --- a/SOURCES/0033-Client-clear-focus-on-touch-cancel.patch +++ b/SOURCES/0031-Client-clear-focus-on-touch-cancel.patch @@ -1,7 +1,7 @@ -From bdf04e01153aeda2c2bafa059dd21dc377eb82e1 Mon Sep 17 00:00:00 2001 +From 6fde7db552af605bfe5884c3525bbc1da951791f Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 5 Aug 2022 15:00:31 +0100 -Subject: [PATCH 33/55] Client: clear focus on touch cancel +Subject: [PATCH 31/59] Client: clear focus on touch cancel When we get a touch_cancel event all touches should be treated as lifted. @@ -23,10 +23,10 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 4 files changed, 39 insertions(+) diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp -index 5d704795..5b880984 100644 +index 988d51af..3b30b853 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp -@@ -1392,6 +1392,7 @@ void QWaylandInputDevice::Touch::touch_cancel() +@@ -1397,6 +1397,7 @@ void QWaylandInputDevice::Touch::touch_cancel() if (touchExt) touchExt->touchCanceled(); @@ -112,5 +112,5 @@ index 296dbf47..210d8ddb 100644 Seat *m_seat = nullptr; }; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0034-Guard-mResizeDirty-by-the-correctMutex.patch b/SOURCES/0032-Guard-mResizeDirty-by-the-correctMutex.patch similarity index 88% rename from SOURCES/0034-Guard-mResizeDirty-by-the-correctMutex.patch rename to SOURCES/0032-Guard-mResizeDirty-by-the-correctMutex.patch index 82ee313..f0ee98e 100644 --- a/SOURCES/0034-Guard-mResizeDirty-by-the-correctMutex.patch +++ b/SOURCES/0032-Guard-mResizeDirty-by-the-correctMutex.patch @@ -1,7 +1,7 @@ -From e920173ee9cef08d10ad8a7e21ae7a5a2c2d7530 Mon Sep 17 00:00:00 2001 +From c3299f5f31f9639b9c6e25359213fe44b6f09a7f Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 3 Feb 2022 19:42:33 +0000 -Subject: [PATCH 34/55] Guard mResizeDirty by the correctMutex +Subject: [PATCH 32/59] Guard mResizeDirty by the correctMutex mResizeDirty is used in the GUI thread in setCanResize which can be called from the GUI thread. It is queried and set whilst the resizeLock @@ -15,7 +15,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 5b7f9df9..117e3383 100644 +index 60665394..e5d1a97d 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -358,11 +358,12 @@ void QWaylandWindow::setGeometry(const QRect &rect) @@ -35,5 +35,5 @@ index 5b7f9df9..117e3383 100644 } QRect exposeGeometry(QPoint(), geometry().size()); -- -2.40.0 +2.46.0 diff --git a/SOURCES/0036-Fix-compile-tests.patch b/SOURCES/0033-Fix-compile-tests.patch similarity index 90% rename from SOURCES/0036-Fix-compile-tests.patch rename to SOURCES/0033-Fix-compile-tests.patch index 83acc1f..93d0a7b 100644 --- a/SOURCES/0036-Fix-compile-tests.patch +++ b/SOURCES/0033-Fix-compile-tests.patch @@ -1,7 +1,7 @@ -From bf6b509011c4086cc7b1a7cfdc78dd50e446b15f Mon Sep 17 00:00:00 2001 +From f209f01217f8f8745be76a192ddac4e753aa83cd Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 9 Sep 2022 15:37:49 +0200 -Subject: [PATCH 36/55] Fix compile tests +Subject: [PATCH 33/59] Fix compile tests Broken in c618467da4c06528537026e2b78f92265bce446f --- @@ -25,5 +25,5 @@ index b063e0d9..2ea382f1 100644 { auto e = window.m_events.takeFirst(); -- -2.40.0 +2.46.0 diff --git a/SOURCES/0039-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch b/SOURCES/0034-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch similarity index 88% rename from SOURCES/0039-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch rename to SOURCES/0034-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch index 777e40d..e5c2128 100644 --- a/SOURCES/0039-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch +++ b/SOURCES/0034-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch @@ -1,7 +1,7 @@ -From 35c03e72007630040659188b2bc7f47b1df82577 Mon Sep 17 00:00:00 2001 +From d3a39dcd13600f00593aef62f12f771f92394d54 Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Sun, 18 Sep 2022 18:17:18 +0800 -Subject: [PATCH 39/55] Call `finishDrag()` in +Subject: [PATCH 34/59] Call `finishDrag()` in `QWaylandDataDevice::dragSourceCancelled()` Drags can either get finished or cancelled. If a drag is finished @@ -22,7 +22,7 @@ BUG: 446111 1 file changed, 1 insertion(+) diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp -index fbb5aa91..e3e60ed5 100644 +index d154c695..9b3c18ac 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -296,6 +296,7 @@ void QWaylandDataDevice::selectionSourceCancelled() @@ -34,5 +34,5 @@ index fbb5aa91..e3e60ed5 100644 } -- -2.40.0 +2.46.0 diff --git a/SOURCES/0040-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch b/SOURCES/0035-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch similarity index 95% rename from SOURCES/0040-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch rename to SOURCES/0035-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch index bb0cfdc..201e4d4 100644 --- a/SOURCES/0040-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch +++ b/SOURCES/0035-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch @@ -1,7 +1,7 @@ -From 37ad4aeaa6dce748f5f6bcc5030be187e6320ec0 Mon Sep 17 00:00:00 2001 +From 8e854aa7c6d6ba8d79e307b2922d8c8fd50609e4 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 12 Sep 2022 13:28:08 +0100 -Subject: [PATCH 40/55] Hold surface read lock throughout +Subject: [PATCH 35/59] Hold surface read lock throughout QWaylandEglWindow::updateSurface QWaylandEGLWindow::updateSurface is called from both the main and render @@ -50,7 +50,7 @@ index 2be87bc0..ea3d1995 100644 }; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp -index 13dd747a..872a6237 100644 +index 64f7caeb..dbe2845a 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -40,6 +40,7 @@ @@ -81,5 +81,5 @@ index 13dd747a..872a6237 100644 } -- -2.40.0 +2.46.0 diff --git a/SOURCES/0035-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch b/SOURCES/0035-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch deleted file mode 100644 index 9cfd102..0000000 --- a/SOURCES/0035-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 1ff4219d8c58f8356d9d12824948013cdfde6ac5 Mon Sep 17 00:00:00 2001 -From: Liang Qi -Date: Fri, 11 Mar 2022 09:17:25 +0100 -Subject: [PATCH 35/55] client: Synthesize enter/leave event for popup in - xdg-shell -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes: QTBUG-100148 -Pick-to: 6.3 6.2 5.15 -Change-Id: I45e3156d7942cff9968674c0b253d15be7235921 -Reviewed-by: Tang Haixiang -Reviewed-by: Qt CI Bot -Reviewed-by: Tor Arne Vestbø -(cherry picked from commit 73d35d3117722cef8e94f0d2036c56ad0a5ddae9) - -* asturmlechner 2022-09-08: Resolve conflict with dev branch commits - b6a3a938abd4a7fdb7ea96a38485b53f394fba17 and - f8e3257e9b1e22d52e9c221c62b8d9b6dd1151a3 ---- - .../xdg-shell/qwaylandxdgshell.cpp | 27 +++++++++++++++++++ - 1 file changed, 27 insertions(+) - -diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index 962001b3..ead99989 100644 ---- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -@@ -221,6 +221,16 @@ QWaylandXdgSurface::Popup::~Popup() - auto *shell = m_xdgSurface->m_shell; - Q_ASSERT(shell->m_topmostGrabbingPopup == this); - shell->m_topmostGrabbingPopup = m_parentXdgSurface ? m_parentXdgSurface->m_popup : nullptr; -+ m_grabbing = false; -+ -+ // Synthesize Qt enter/leave events for popup -+ QWindow *leave = nullptr; -+ if (m_xdgSurface && m_xdgSurface->window()) -+ leave = m_xdgSurface->window()->window(); -+ QWindowSystemInterface::handleLeaveEvent(leave); -+ -+ if (QWindow *enter = QGuiApplication::topLevelAt(QCursor::pos())) -+ QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos()); - } - } - -@@ -442,6 +452,23 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic - } - setPopup(parent); - m_popup->grab(device, serial); -+ -+ // Synthesize Qt enter/leave events for popup -+ if (!parent) -+ return; -+ QWindow *current = QGuiApplication::topLevelAt(QCursor::pos()); -+ QWindow *leave = parent->window(); -+ if (current != leave) -+ return; -+ -+ QWindowSystemInterface::handleLeaveEvent(leave); -+ -+ QWindow *enter = nullptr; -+ if (m_popup && m_popup->m_xdgSurface && m_popup->m_xdgSurface->window()) -+ enter = m_popup->m_xdgSurface->window()->window(); -+ -+ if (enter) -+ QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos()); - } - - void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) --- -2.40.0 - diff --git a/SOURCES/0042-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch b/SOURCES/0036-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch similarity index 90% rename from SOURCES/0042-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch rename to SOURCES/0036-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch index cc97967..6e6a273 100644 --- a/SOURCES/0042-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch +++ b/SOURCES/0036-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch @@ -1,7 +1,7 @@ -From 61fccee064cd8cea698a530c76113f8487d11d68 Mon Sep 17 00:00:00 2001 +From 0c7dc84573f85d464ddfe13f3352b284f445ba4e Mon Sep 17 00:00:00 2001 From: David Redondo Date: Wed, 8 Jun 2022 11:25:59 +0200 -Subject: [PATCH 42/55] Keep toplevel windows in the top left corner of the +Subject: [PATCH 36/59] Keep toplevel windows in the top left corner of the screen We can't know the actual position of a window on the screen. This causes @@ -39,10 +39,10 @@ index fbf00c6b..54861600 100644 QWaylandIntegration::~QWaylandIntegration() diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 1f2d56b5..d3459168 100644 +index e5d1a97d..464441b1 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp -@@ -361,8 +361,13 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect) +@@ -350,8 +350,13 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect) } } @@ -57,7 +57,7 @@ index 1f2d56b5..d3459168 100644 setGeometry_helper(rect); if (window()->isVisible() && rect.isValid()) { -@@ -1044,6 +1049,13 @@ void QWaylandWindow::handleScreensChanged() +@@ -1033,6 +1038,13 @@ void QWaylandWindow::handleScreensChanged() QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->QPlatformScreen::screen()); mLastReportedScreen = newScreen; @@ -72,7 +72,7 @@ index 1f2d56b5..d3459168 100644 int scale = newScreen->isPlaceholder() ? 1 : static_cast(newScreen)->scale(); if (scale != mScale) { diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h -index e18609d9..a8ee2696 100644 +index ea3d1995..487a91a6 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -98,6 +98,9 @@ public: @@ -86,5 +86,5 @@ index e18609d9..a8ee2696 100644 virtual void ensureSize(); WId winId() const override; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0044-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch b/SOURCES/0037-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch similarity index 92% rename from SOURCES/0044-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch rename to SOURCES/0037-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch index 2f9ec44..5374ba4 100644 --- a/SOURCES/0044-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch +++ b/SOURCES/0037-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch @@ -1,7 +1,7 @@ -From dd605d5fec6921a7befbfe2c40c2ae87935aa9c4 Mon Sep 17 00:00:00 2001 +From d177cf9520a415ff46ca9351c4ddbf72d52b460f Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 17 Nov 2022 15:25:37 +0200 -Subject: [PATCH 44/55] Client: Add F_SEAL_SHRINK seal to shm backing file +Subject: [PATCH 37/59] Client: Add F_SEAL_SHRINK seal to shm backing file This lets libwayland-server avoid installing a SIGBUS handler when it wants to mmap() the backing file and access the contents of shared @@ -49,5 +49,5 @@ index dc7ff670..98acd42d 100644 QScopedPointer filePointer; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0037-Use-CRLF-line-delimiter-for-text-uri-list-data.patch b/SOURCES/0037-Use-CRLF-line-delimiter-for-text-uri-list-data.patch deleted file mode 100644 index 3664c5c..0000000 --- a/SOURCES/0037-Use-CRLF-line-delimiter-for-text-uri-list-data.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 137958eec28cb8209069f9a3a3ab778202773ff6 Mon Sep 17 00:00:00 2001 -From: Alexandros Frantzis -Date: Wed, 11 May 2022 17:12:52 +0300 -Subject: [PATCH 37/55] Use CRLF line delimiter for text/uri-list data - -According to RFC 2483, which describes text/uri-list, the line delimiter -must be CRLF (instead of the currently used LF). Some applications -strictly expect the CRLF delimiter and fail to properly parse the -uri-list otherwise (e.g., WineX11/XWayland). - -https://datatracker.ietf.org/doc/html/rfc2483 - -5. The text/uri-list Internet Media Type -The format of text/uri-list resources is: -3) As for all text/* formats, lines are terminated with a CRLF pair. - -Pick-to: 6.4 6.3 6.2 5.15 -Change-Id: I7c062224a9060028ab6293fdf172692ade28cca5 -Reviewed-by: David Edmundson -(cherry picked from commit bd5b0a804b91b9fbd0ce44d5d6765e07d0a50b4f) ---- - src/shared/qwaylandmimehelper.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/shared/qwaylandmimehelper.cpp b/src/shared/qwaylandmimehelper.cpp -index 051a91dc..e2fe1928 100644 ---- a/src/shared/qwaylandmimehelper.cpp -+++ b/src/shared/qwaylandmimehelper.cpp -@@ -74,7 +74,7 @@ QByteArray QWaylandMimeHelper::getByteArray(QMimeData *mimeData, const QString & - QList urls = mimeData->urls(); - for (int i = 0; i < urls.count(); ++i) { - content.append(urls.at(i).toEncoded()); -- content.append('\n'); -+ content.append("\r\n"); - } - } else { - content = mimeData->data(mimeType); --- -2.40.0 - diff --git a/SOURCES/0038-Avoid-calling-requestUpdate-from-wrong-thread.patch b/SOURCES/0038-Avoid-calling-requestUpdate-from-wrong-thread.patch deleted file mode 100644 index dc29759..0000000 --- a/SOURCES/0038-Avoid-calling-requestUpdate-from-wrong-thread.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0064749af275016ae3b4b09964d8d31d756d3468 Mon Sep 17 00:00:00 2001 -From: Eskil Abrahamsen Blomfeldt -Date: Mon, 8 Aug 2022 12:14:01 +0200 -Subject: [PATCH 38/55] Avoid calling requestUpdate from wrong thread - -In certain circumstances, we can get to createDecoration() -from the render thread (from QWaylandGLContext::makeCurrent) - -Calling requestUpdate() from this secondary thread would -cause an assert, so we queue the call on the appropriate -thread instead. - -This amends af7b60ade5c4be81cbc58eb18307c017d5594071. - -Pick-to: 5.15 6.2 6.3 6.3.2 6.4 -Fixes: QTBUG-105308 -Change-Id: I4805265f39e24eb1464897532be2025bc3c27728 -Reviewed-by: Inho Lee -(cherry picked from commit a0c0b5b42335808c2222cbf72c1758e955731ed9) ---- - src/client/qwaylandwindow.cpp | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 117e3383..4ddf9fbe 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -873,7 +873,11 @@ bool QWaylandWindow::createDecoration() - // size and are not redrawn, leaving the new buffer empty. As a simple - // work-around, we trigger a full extra update whenever the client-side - // window decorations are toggled while the window is showing. -- window()->requestUpdate(); -+ // Note: createDecoration() is sometimes called from the render thread -+ // of Qt Quick. This is essentially wrong and could potentially cause problems, -+ // but until the underlying issue has been fixed, we have to use invokeMethod() -+ // here to avoid asserts. -+ QMetaObject::invokeMethod(window(), &QWindow::requestUpdate); - } - - return mWindowDecoration; --- -2.40.0 - diff --git a/SOURCES/0045-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch b/SOURCES/0038-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch similarity index 87% rename from SOURCES/0045-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch rename to SOURCES/0038-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch index 3d44293..a4ff150 100644 --- a/SOURCES/0045-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch +++ b/SOURCES/0038-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch @@ -1,7 +1,7 @@ -From dea12f0bb5729de6c1a31b03b7e79710baf96b63 Mon Sep 17 00:00:00 2001 +From 6a0baec0d8766b55655aef13d88546e1261348d7 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 21 Nov 2022 18:39:40 +0200 -Subject: [PATCH 45/55] Client: Call wl_output_release() upon QWaylandScreen +Subject: [PATCH 38/59] Client: Call wl_output_release() upon QWaylandScreen destruction It ensures that the proxy gets destroyed. @@ -27,5 +27,5 @@ index 7c2d9be3..64ae4fe7 100644 uint QWaylandScreen::requiredEvents() const -- -2.40.0 +2.46.0 diff --git a/SOURCES/0046-Client-Bump-wl_output-version.patch b/SOURCES/0039-Client-Bump-wl_output-version.patch similarity index 89% rename from SOURCES/0046-Client-Bump-wl_output-version.patch rename to SOURCES/0039-Client-Bump-wl_output-version.patch index 29740c9..5fc2214 100644 --- a/SOURCES/0046-Client-Bump-wl_output-version.patch +++ b/SOURCES/0039-Client-Bump-wl_output-version.patch @@ -1,7 +1,7 @@ -From 8071f24324ffa8c556068816e009a5887e1a6ddd Mon Sep 17 00:00:00 2001 +From 4f835bf318a39e9703a825bcf17d16f1838462fe Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 22 Nov 2022 12:33:41 +0200 -Subject: [PATCH 46/55] Client: Bump wl_output version +Subject: [PATCH 39/59] Client: Bump wl_output version wl_output_release is available starting with wl_output v3. @@ -26,5 +26,5 @@ index 64ae4fe7..5537dafd 100644 , mWaylandDisplay(waylandDisplay) , mOutputName(QStringLiteral("Screen%1").arg(id)) -- -2.40.0 +2.46.0 diff --git a/SOURCES/0047-Fix-frame-sync-related-to-unprotected-multithread-ac.patch b/SOURCES/0040-Fix-frame-sync-related-to-unprotected-multithread-ac.patch similarity index 95% rename from SOURCES/0047-Fix-frame-sync-related-to-unprotected-multithread-ac.patch rename to SOURCES/0040-Fix-frame-sync-related-to-unprotected-multithread-ac.patch index 723d07c..9710ed7 100644 --- a/SOURCES/0047-Fix-frame-sync-related-to-unprotected-multithread-ac.patch +++ b/SOURCES/0040-Fix-frame-sync-related-to-unprotected-multithread-ac.patch @@ -1,7 +1,7 @@ -From ef5b1f40b684927f73bc04ab84c396be074cb61e Mon Sep 17 00:00:00 2001 +From 085ca8ffe2e74ba8ba217ab32d1b84024cdd2802 Mon Sep 17 00:00:00 2001 From: Weng Xuetian Date: Sun, 27 Nov 2022 12:44:40 -0800 -Subject: [PATCH 47/55] Fix frame sync related to unprotected multithread +Subject: [PATCH 40/59] Fix frame sync related to unprotected multithread access There is a few crashes happens in real life that frame callback is @@ -21,7 +21,7 @@ Change-Id: Ie01d08d07a2f10f70606ed1935caac09cb4f0382 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index f322a8d6..6337db00 100644 +index 464441b1..96de798b 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -252,13 +252,16 @@ void QWaylandWindow::reset() @@ -76,7 +76,7 @@ index f322a8d6..6337db00 100644 mWaitingForFrameCallback = false; mFrameCallbackElapsedTimer.invalidate(); -@@ -1169,19 +1175,24 @@ void QWaylandWindow::timerEvent(QTimerEvent *event) +@@ -1172,19 +1178,24 @@ void QWaylandWindow::timerEvent(QTimerEvent *event) if (event->timerId() != mFrameCallbackCheckIntervalTimerId) return; @@ -112,7 +112,7 @@ index f322a8d6..6337db00 100644 } void QWaylandWindow::requestUpdate() -@@ -1224,15 +1235,14 @@ void QWaylandWindow::handleUpdate() +@@ -1227,15 +1238,14 @@ void QWaylandWindow::handleUpdate() { qCDebug(lcWaylandBackingstore) << "handleUpdate" << QThread::currentThread(); @@ -162,5 +162,5 @@ index 487a91a6..2f219d8c 100644 static QWaylandWindow *mMouseGrab; -- -2.40.0 +2.46.0 diff --git a/SOURCES/0041-Client-Ensure-that-wl_surface-lives-as-long-as-qtqui.patch b/SOURCES/0041-Client-Ensure-that-wl_surface-lives-as-long-as-qtqui.patch deleted file mode 100644 index 95aa134..0000000 --- a/SOURCES/0041-Client-Ensure-that-wl_surface-lives-as-long-as-qtqui.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 1012f1d4b5753ad63da3cca1226fb034e297ae6d Mon Sep 17 00:00:00 2001 -From: Vlad Zahorodnii -Date: Tue, 8 Nov 2022 16:10:18 +0200 -Subject: [PATCH 41/55] Client: Ensure that wl_surface lives as long as qtquick - render thread needs it - -wl_surface can be destroyed while qtquick render thread still uses it. -That can end up in eglSwapBuffers() using defunct wl_surface, which will -eventually lead to a crash due to the compositor posting an error. - -This is partially cherry-pick of dff579147b07cd15888a47c303e36684e9930f9f - -Change-Id: I044f40dd64e6672027a833379b57ccd9973d8305 ---- - src/client/qwaylandwindow.cpp | 13 ++++++++++++- - src/client/qwaylandwindow_p.h | 3 +++ - .../client/wayland-egl/qwaylandglcontext.cpp | 6 +++++- - 3 files changed, 20 insertions(+), 2 deletions(-) - -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 4ddf9fbe..1f2d56b5 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -76,6 +76,7 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr; - QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display) - : QPlatformWindow(window) - , mDisplay(display) -+ , mSurfaceLock(QReadWriteLock::Recursive) - , mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP")) - { - { -@@ -237,6 +238,16 @@ bool QWaylandWindow::shouldCreateSubSurface() const - return QPlatformWindow::parent() != nullptr; - } - -+void QWaylandWindow::beginFrame() -+{ -+ mSurfaceLock.lockForRead(); -+} -+ -+void QWaylandWindow::endFrame() -+{ -+ mSurfaceLock.unlock(); -+} -+ - void QWaylandWindow::reset() - { - closeChildPopups(); -@@ -245,10 +256,10 @@ void QWaylandWindow::reset() - delete mSubSurfaceWindow; - mSubSurfaceWindow = nullptr; - -- invalidateSurface(); - if (mSurface) { - emit wlSurfaceDestroyed(); - QWriteLocker lock(&mSurfaceLock); -+ invalidateSurface(); - mSurface.reset(); - } - -diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h -index ea3d1995..e18609d9 100644 ---- a/src/client/qwaylandwindow_p.h -+++ b/src/client/qwaylandwindow_p.h -@@ -207,6 +207,9 @@ public: - void handleUpdate(); - void deliverUpdateRequest() override; - -+ void beginFrame(); -+ void endFrame(); -+ - void addChildPopup(QWaylandWindow* child); - void removeChildPopup(QWaylandWindow* child); - void closeChildPopups(); -diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -index c1f45fa6..5d6fb2bf 100644 ---- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -@@ -432,8 +432,10 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) - return true; - } - -- if (window->isExposed()) -+ if (window->isExposed()) { -+ window->beginFrame(); - window->setCanResize(false); -+ } - if (m_decorationsContext != EGL_NO_CONTEXT && !window->decoration()) - window->createDecoration(); - -@@ -449,6 +451,7 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) - if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) { - qWarning("QWaylandGLContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this); - window->setCanResize(true); -+ window->endFrame(); - return false; - } - -@@ -502,6 +505,7 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface) - eglSwapBuffers(m_eglDisplay, eglSurface); - - window->setCanResize(true); -+ window->endFrame(); - } - - GLuint QWaylandGLContext::defaultFramebufferObject(QPlatformSurface *surface) const --- -2.40.0 - diff --git a/SOURCES/0048-Client-Handle-zwp_primary_selection_device_manager_v.patch b/SOURCES/0041-Client-Handle-zwp_primary_selection_device_manager_v.patch similarity index 93% rename from SOURCES/0048-Client-Handle-zwp_primary_selection_device_manager_v.patch rename to SOURCES/0041-Client-Handle-zwp_primary_selection_device_manager_v.patch index 727159b..2d70947 100644 --- a/SOURCES/0048-Client-Handle-zwp_primary_selection_device_manager_v.patch +++ b/SOURCES/0041-Client-Handle-zwp_primary_selection_device_manager_v.patch @@ -1,7 +1,7 @@ -From 21e354e7b1878a243d29466b19084083df3d0db9 Mon Sep 17 00:00:00 2001 +From 01a9aef0a5630382039ba08d20427c69d43dc91e Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 27 Sep 2022 22:05:07 +0300 -Subject: [PATCH 48/55] Client: Handle zwp_primary_selection_device_manager_v1 +Subject: [PATCH 41/59] Client: Handle zwp_primary_selection_device_manager_v1 global removal The zwp_primary_selection_device_manager_v1 global can be withdrawn if @@ -19,7 +19,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp -index 6898a881..27f55965 100644 +index f23c459d..cc321497 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -519,6 +519,8 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin @@ -46,7 +46,7 @@ index 6898a881..27f55965 100644 break; } diff --git a/src/client/qwaylandprimaryselectionv1.cpp b/src/client/qwaylandprimaryselectionv1.cpp -index 832f9678..ea508771 100644 +index 7805dd73..dac532b2 100644 --- a/src/client/qwaylandprimaryselectionv1.cpp +++ b/src/client/qwaylandprimaryselectionv1.cpp @@ -54,11 +54,6 @@ QWaylandPrimarySelectionDeviceManagerV1::QWaylandPrimarySelectionDeviceManagerV1 @@ -62,5 +62,5 @@ index 832f9678..ea508771 100644 QWaylandPrimarySelectionDeviceV1 *QWaylandPrimarySelectionDeviceManagerV1::createDevice(QWaylandInputDevice *seat) -- -2.40.0 +2.46.0 diff --git a/SOURCES/0049-Fixes-the-build-on-CentOS.patch b/SOURCES/0042-Fixes-the-build-on-CentOS.patch similarity index 87% rename from SOURCES/0049-Fixes-the-build-on-CentOS.patch rename to SOURCES/0042-Fixes-the-build-on-CentOS.patch index 0d15bba..5ec9573 100644 --- a/SOURCES/0049-Fixes-the-build-on-CentOS.patch +++ b/SOURCES/0042-Fixes-the-build-on-CentOS.patch @@ -1,7 +1,7 @@ -From c12b0ed6db709e2af40ab3687d880aff5c56b5c1 Mon Sep 17 00:00:00 2001 +From 8fd1873b3c80cb641d8756b8c04d305c8320b6e8 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 19 Dec 2022 15:31:03 +0100 -Subject: [PATCH 49/55] Fixes the build on CentOS +Subject: [PATCH 42/59] Fixes the build on CentOS Change-Id: I3c21972e7681be99b0f45c3ea3a57be285e4ff8e --- @@ -22,5 +22,5 @@ index 98acd42d..41cffdf7 100644 if (fd >= 0) fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); -- -2.40.0 +2.46.0 diff --git a/SOURCES/0043-Revert-Client-Ensure-that-wl_surface-lives-as-long-a.patch b/SOURCES/0043-Revert-Client-Ensure-that-wl_surface-lives-as-long-a.patch deleted file mode 100644 index ffe2322..0000000 --- a/SOURCES/0043-Revert-Client-Ensure-that-wl_surface-lives-as-long-a.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 3813da4b6d88320b42a7d91ae100e1567113ee72 Mon Sep 17 00:00:00 2001 -From: David Edmundson -Date: Mon, 14 Nov 2022 10:43:25 +0000 -Subject: [PATCH 43/55] Revert "Client: Ensure that wl_surface lives as long as - qtquick render thread needs it" - -This reverts commit 81a7702a87f386a60a0ac8c902e203daae044d81 ---- - src/client/qwaylandwindow.cpp | 13 +------------ - src/client/qwaylandwindow_p.h | 3 --- - .../client/wayland-egl/qwaylandglcontext.cpp | 6 +----- - 3 files changed, 2 insertions(+), 20 deletions(-) - -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index d3459168..f322a8d6 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -76,7 +76,6 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr; - QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display) - : QPlatformWindow(window) - , mDisplay(display) -- , mSurfaceLock(QReadWriteLock::Recursive) - , mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP")) - { - { -@@ -238,16 +237,6 @@ bool QWaylandWindow::shouldCreateSubSurface() const - return QPlatformWindow::parent() != nullptr; - } - --void QWaylandWindow::beginFrame() --{ -- mSurfaceLock.lockForRead(); --} -- --void QWaylandWindow::endFrame() --{ -- mSurfaceLock.unlock(); --} -- - void QWaylandWindow::reset() - { - closeChildPopups(); -@@ -256,10 +245,10 @@ void QWaylandWindow::reset() - delete mSubSurfaceWindow; - mSubSurfaceWindow = nullptr; - -+ invalidateSurface(); - if (mSurface) { - emit wlSurfaceDestroyed(); - QWriteLocker lock(&mSurfaceLock); -- invalidateSurface(); - mSurface.reset(); - } - -diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h -index a8ee2696..487a91a6 100644 ---- a/src/client/qwaylandwindow_p.h -+++ b/src/client/qwaylandwindow_p.h -@@ -210,9 +210,6 @@ public: - void handleUpdate(); - void deliverUpdateRequest() override; - -- void beginFrame(); -- void endFrame(); -- - void addChildPopup(QWaylandWindow* child); - void removeChildPopup(QWaylandWindow* child); - void closeChildPopups(); -diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -index 5d6fb2bf..c1f45fa6 100644 ---- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -@@ -432,10 +432,8 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) - return true; - } - -- if (window->isExposed()) { -- window->beginFrame(); -+ if (window->isExposed()) - window->setCanResize(false); -- } - if (m_decorationsContext != EGL_NO_CONTEXT && !window->decoration()) - window->createDecoration(); - -@@ -451,7 +449,6 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) - if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) { - qWarning("QWaylandGLContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this); - window->setCanResize(true); -- window->endFrame(); - return false; - } - -@@ -505,7 +502,6 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface) - eglSwapBuffers(m_eglDisplay, eglSurface); - - window->setCanResize(true); -- window->endFrame(); - } - - GLuint QWaylandGLContext::defaultFramebufferObject(QPlatformSurface *surface) const --- -2.40.0 - diff --git a/SOURCES/0050-client-Avoid-protocol-error-with-invalid-min-max-siz.patch b/SOURCES/0043-client-Avoid-protocol-error-with-invalid-min-max-siz.patch similarity index 93% rename from SOURCES/0050-client-Avoid-protocol-error-with-invalid-min-max-siz.patch rename to SOURCES/0043-client-Avoid-protocol-error-with-invalid-min-max-siz.patch index de04d80..ff624d1 100644 --- a/SOURCES/0050-client-Avoid-protocol-error-with-invalid-min-max-siz.patch +++ b/SOURCES/0043-client-Avoid-protocol-error-with-invalid-min-max-siz.patch @@ -1,7 +1,7 @@ -From d04d4c7fe2e00285e7d70da42094f213e13c6ed8 Mon Sep 17 00:00:00 2001 +From 1ec26fd1271843760f52f19bae78b9f4acd0d260 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 23 May 2022 09:47:24 +0200 -Subject: [PATCH 50/55] client: Avoid protocol error with invalid min/max size +Subject: [PATCH 43/59] client: Avoid protocol error with invalid min/max size If the application sets an invalid minimum and maximum size (where the minimum is higher than the maximum), then we @@ -35,7 +35,7 @@ Reviewed-by: David Edmundson 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index ead99989..ad666129 100644 +index bca8ad83..2cc36510 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -384,10 +384,10 @@ void QWaylandXdgSurface::setSizeHints() @@ -52,5 +52,5 @@ index ead99989..ad666129 100644 maxHeight = 0; m_toplevel->set_max_size(maxWidth, maxHeight); -- -2.40.0 +2.46.0 diff --git a/SOURCES/0051-Client-Fix-handling-of-Qt-BlankCursor.patch b/SOURCES/0044-Client-Fix-handling-of-Qt-BlankCursor.patch similarity index 87% rename from SOURCES/0051-Client-Fix-handling-of-Qt-BlankCursor.patch rename to SOURCES/0044-Client-Fix-handling-of-Qt-BlankCursor.patch index de310e5..cd94db7 100644 --- a/SOURCES/0051-Client-Fix-handling-of-Qt-BlankCursor.patch +++ b/SOURCES/0044-Client-Fix-handling-of-Qt-BlankCursor.patch @@ -1,7 +1,7 @@ -From fbb9d65cf158bcf63440e9839acae9238ad4e0a7 Mon Sep 17 00:00:00 2001 +From 51d678d70d5665a40a64347f4c3e1709519944e1 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 22 Nov 2022 23:27:34 +0200 -Subject: [PATCH 51/55] Client: Fix handling of Qt::BlankCursor +Subject: [PATCH 44/59] 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 @@ -20,7 +20,7 @@ Reviewed-by: Qt CI Bot 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp -index 5b880984..9a0fe49d 100644 +index 3b30b853..74f16b70 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -310,8 +310,7 @@ void QWaylandInputDevice::Pointer::updateCursor() @@ -34,5 +34,5 @@ index 5b880984..9a0fe49d 100644 } -- -2.40.0 +2.46.0 diff --git a/SOURCES/0052-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch b/SOURCES/0045-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch similarity index 94% rename from SOURCES/0052-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch rename to SOURCES/0045-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch index 28e517b..a2dbf82 100644 --- a/SOURCES/0052-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch +++ b/SOURCES/0045-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch @@ -1,7 +1,7 @@ -From 6897f62f603df049135347cf402a7a4037092263 Mon Sep 17 00:00:00 2001 +From ce279afce294af1d175c7e500be0a77cfbba7f34 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 24 Feb 2023 17:40:48 +0100 -Subject: [PATCH 52/55] client: Force a roundtrip when an XdgOutput is not +Subject: [PATCH 45/59] client: Force a roundtrip when an XdgOutput is not ready yet Is possible that the server sends a surface_enter before @@ -21,7 +21,7 @@ Reviewed-by: David Edmundson 4 files changed, 42 insertions(+) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 6337db00..3b700002 100644 +index 96de798b..5280a9f7 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -1042,6 +1042,8 @@ void QWaylandWindow::handleScreensChanged() @@ -61,7 +61,7 @@ index 210d8ddb..00c439e1 100644 void output_bind_resource(Resource *resource) override; }; diff --git a/tests/auto/client/xdgoutput/tst_xdgoutput.cpp b/tests/auto/client/xdgoutput/tst_xdgoutput.cpp -index 80429608..68e8d77a 100644 +index 20f762e0..2a0cad1d 100644 --- a/tests/auto/client/xdgoutput/tst_xdgoutput.cpp +++ b/tests/auto/client/xdgoutput/tst_xdgoutput.cpp @@ -55,6 +55,7 @@ private slots: @@ -73,7 +73,7 @@ index 80429608..68e8d77a 100644 void tst_xdgoutput::cleanup() @@ -134,5 +135,39 @@ void tst_xdgoutput::changeGeometry() - exec([=] { remove(output(1)); }); + exec([&] { remove(output(1)); }); } +void tst_xdgoutput::outputCreateEnterRace() @@ -113,5 +113,5 @@ index 80429608..68e8d77a 100644 QCOMPOSITOR_TEST_MAIN(tst_xdgoutput) #include "tst_xdgoutput.moc" -- -2.40.0 +2.46.0 diff --git a/SOURCES/0046-Destroy-frame-queue-before-display.patch b/SOURCES/0046-Destroy-frame-queue-before-display.patch new file mode 100644 index 0000000..7671ab8 --- /dev/null +++ b/SOURCES/0046-Destroy-frame-queue-before-display.patch @@ -0,0 +1,38 @@ +From 173336beae7ec1007fd8d57b11e6855f4d249d37 Mon Sep 17 00:00:00 2001 +From: David Redondo +Date: Tue, 11 Apr 2023 14:27:27 +0200 +Subject: [PATCH 46/59] Destroy frame queue before display + +wl_event_queue_destroy accesses the display. +Found by running a test under valgrind. + +Pick-to: 6.5 +Change-Id: Ic89cbd3b6e98b4fc9561b0e63b5fab4886a1ec50 +Reviewed-by: David Edmundson +(cherry picked from commit a76bf824fcd1cc3789f0d3454a0423c0241d9718) +--- + src/client/qwaylanddisplay.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp +index cc321497..737b539d 100644 +--- a/src/client/qwaylanddisplay.cpp ++++ b/src/client/qwaylanddisplay.cpp +@@ -379,11 +379,12 @@ QWaylandDisplay::~QWaylandDisplay(void) + #if QT_CONFIG(cursor) + qDeleteAll(mCursorThemes); + #endif +- if (mDisplay) +- wl_display_disconnect(mDisplay); + + if (m_frameEventQueue) + wl_event_queue_destroy(m_frameEventQueue); ++ ++ if (mDisplay) ++ wl_display_disconnect(mDisplay); + } + + // Steps which is called just after constructor. This separates registry_global() out of the constructor +-- +2.46.0 + diff --git a/SOURCES/0047-client-Fix-crash-on-dnd-updates-after-client-facing-.patch b/SOURCES/0047-client-Fix-crash-on-dnd-updates-after-client-facing-.patch new file mode 100644 index 0000000..b340753 --- /dev/null +++ b/SOURCES/0047-client-Fix-crash-on-dnd-updates-after-client-facing-.patch @@ -0,0 +1,42 @@ +From fa30cef910a9a57fbe2f90422789882834fdac9b Mon Sep 17 00:00:00 2001 +From: David Edmundson +Date: Wed, 7 Jun 2023 22:12:15 +0100 +Subject: [PATCH 47/59] client: Fix crash on dnd updates after client facing + drag ends + +A platform drag and a application-facing drag have two different +lifespans. + +The platform drag lasts until all mimedata is transferred and the client +receiving the drops marks it as finished. + +The application facing QDrag lasts until the client deletes it. We can +get a crash if we get updates during this time. + +The drop event is guarded, but not the action negotiation. + +Pick-to: 6.6 +Change-Id: Ib9c047f04d65883105d4cd3f169637d0e038a63f +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit 22daca49b807fefba58113a06b86df4274e49f62) +--- + src/client/qwaylanddatadevice.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp +index 9b3c18ac..9c3308d5 100644 +--- a/src/client/qwaylanddatadevice.cpp ++++ b/src/client/qwaylanddatadevice.cpp +@@ -132,6 +132,9 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supporte + connect(m_dragSource.data(), &QWaylandDataSource::cancelled, this, &QWaylandDataDevice::dragSourceCancelled); + connect(m_dragSource.data(), &QWaylandDataSource::dndResponseUpdated, this, [this](bool accepted, Qt::DropAction action) { + auto drag = static_cast(QGuiApplicationPrivate::platformIntegration()->drag()); ++ if (!drag->currentDrag()) { ++ return; ++ } + // in old versions drop action is not set, so we guess + if (wl_data_source_get_version(m_dragSource->object()) < 3) { + drag->setResponse(accepted); +-- +2.46.0 + diff --git a/SOURCES/0048-Convert-cursor-bitmap-to-supported-format.patch b/SOURCES/0048-Convert-cursor-bitmap-to-supported-format.patch new file mode 100644 index 0000000..7ecfa8a --- /dev/null +++ b/SOURCES/0048-Convert-cursor-bitmap-to-supported-format.patch @@ -0,0 +1,66 @@ +From 31979df9078cad1519e8e37929fc84a9ed8f711c Mon Sep 17 00:00:00 2001 +From: Michael Weghorn +Date: Mon, 20 Feb 2023 14:02:23 +0100 +Subject: [PATCH 48/59] Convert cursor bitmap to supported format + +The 1-bit image formats QImage::Format_Mono and +QImage::Format_MonoLSB used by cursor bitmaps don't have +a corresponding wl_shm_format. + +Therefore, convert to a supported image format as necessary +to make such bitmap cursors work on Wayland as well. + +Fixes: QTBUG-95434 +Change-Id: I402fd870b301ddc01075251b66f2cf7cc1923133 +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit 45ec1362f8fcb5ade92f4d2d4985b1c24e78c8ba) + +Backport changes: Use Qt::ReturnByValue version for QCursor::mask() and QCursor::bitmap() +--- + src/client/qwaylandcursor.cpp | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp +index e4eca9d4..ba76ba2d 100644 +--- a/src/client/qwaylandcursor.cpp ++++ b/src/client/qwaylandcursor.cpp +@@ -44,6 +44,7 @@ + #include "qwaylandshmbackingstore_p.h" + + #include ++#include + #include + + #include +@@ -250,7 +251,27 @@ QWaylandCursor::QWaylandCursor(QWaylandDisplay *display) + QSharedPointer QWaylandCursor::cursorBitmapBuffer(QWaylandDisplay *display, const QCursor *cursor) + { + Q_ASSERT(cursor->shape() == Qt::BitmapCursor); +- const QImage &img = cursor->pixmap().toImage(); ++ ++ const QBitmap mask = cursor->mask(Qt::ReturnByValue); ++ QImage img; ++ if (cursor->pixmap().isNull()) ++ img = cursor->bitmap(Qt::ReturnByValue).toImage(); ++ else ++ img = cursor->pixmap().toImage(); ++ ++ // convert to supported format if necessary ++ if (!display->shm()->formatSupported(img.format())) { ++ if (mask.isNull()) { ++ img.convertTo(QImage::Format_RGB32); ++ } else { ++ // preserve mask ++ img.convertTo(QImage::Format_ARGB32); ++ QPixmap pixmap = QPixmap::fromImage(img); ++ pixmap.setMask(mask); ++ img = pixmap.toImage(); ++ } ++ } ++ + QSharedPointer buffer(new QWaylandShmBuffer(display, img.size(), img.format())); + memcpy(buffer->image()->bits(), img.bits(), size_t(img.sizeInBytes())); + return buffer; +-- +2.46.0 + diff --git a/SOURCES/0049-Replace-scale-with-devicePixelRatio-for-non-integer-.patch b/SOURCES/0049-Replace-scale-with-devicePixelRatio-for-non-integer-.patch new file mode 100644 index 0000000..640e2c0 --- /dev/null +++ b/SOURCES/0049-Replace-scale-with-devicePixelRatio-for-non-integer-.patch @@ -0,0 +1,169 @@ +From 6b87344bf9eab15be34ed6a86c83b19b6eb0dde2 Mon Sep 17 00:00:00 2001 +From: Jungi Byun +Date: Wed, 27 Jan 2021 08:24:23 +0900 +Subject: [PATCH 49/59] Replace scale with devicePixelRatio for non-integer + scaling + +The 'scale' event from wayland cannot support non-integer scaling +which was originally supported in Qt. + +As default, devicePixelRatio follows the 'scale' so that the high DPI +still works as the mechanism in Wayland. But if non-integer scaling +factor such as 150% is needed, it can be supported to override the +devicePixelRatio. + +Change-Id: I63a04db27bd521264b6d0904e1ddd05a572dc970 +Reviewed-by: Elvis Lee +Reviewed-by: Jungi Byun +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit cf98abbc6ae9ba9373803ffe193f839324e0c80b) +--- + src/client/qwaylandabstractdecoration.cpp | 2 +- + src/client/qwaylandshmbackingstore.cpp | 6 +++--- + src/client/qwaylandshmbackingstore_p.h | 2 +- + src/client/qwaylandwindow.cpp | 16 ++++++++-------- + src/client/qwaylandwindow_p.h | 2 +- + .../client/wayland-egl/qwaylandglcontext.cpp | 2 +- + 6 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp +index b628930d..d15a7f9f 100644 +--- a/src/client/qwaylandabstractdecoration.cpp ++++ b/src/client/qwaylandabstractdecoration.cpp +@@ -122,7 +122,7 @@ const QImage &QWaylandAbstractDecoration::contentImage() + if (d->m_isDirty) { + // Update the decoration backingstore + +- const int bufferScale = waylandWindow()->scale(); ++ const qreal bufferScale = waylandWindow()->scale(); + const QSize imageSize = waylandWindow()->surfaceSize() * bufferScale; + d->m_decorationContentImage = QImage(imageSize, QImage::Format_ARGB32_Premultiplied); + // Only scale by buffer scale, not QT_SCALE_FACTOR etc. +diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp +index 41cffdf7..90e37e95 100644 +--- a/src/client/qwaylandshmbackingstore.cpp ++++ b/src/client/qwaylandshmbackingstore.cpp +@@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE + namespace QtWaylandClient { + + QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display, +- const QSize &size, QImage::Format format, int scale) ++ const QSize &size, QImage::Format format, qreal scale) + { + int stride = size.width() * 4; + int alloc = stride * size.height(); +@@ -114,7 +114,7 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display, + QWaylandShm* shm = display->shm(); + wl_shm_format wl_format = shm->formatFrom(format); + mImage = QImage(data, size.width(), size.height(), stride, format); +- mImage.setDevicePixelRatio(qreal(scale)); ++ mImage.setDevicePixelRatio(scale); + + mShmPool = wl_shm_create_pool(shm->object(), fd, alloc); + init(wl_shm_pool_create_buffer(mShmPool,0, size.width(), size.height(), +@@ -277,7 +277,7 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size) + void QWaylandShmBackingStore::resize(const QSize &size) + { + QMargins margins = windowDecorationMargins(); +- int scale = waylandWindow()->scale(); ++ qreal scale = waylandWindow()->scale(); + QSize sizeWithMargins = (size + QSize(margins.left()+margins.right(),margins.top()+margins.bottom())) * scale; + + // We look for a free buffer to draw into. If the buffer is not the last buffer we used, +diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h +index e01632da..f3fae438 100644 +--- a/src/client/qwaylandshmbackingstore_p.h ++++ b/src/client/qwaylandshmbackingstore_p.h +@@ -71,7 +71,7 @@ class QWaylandWindow; + class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBuffer : public QWaylandBuffer { + public: + QWaylandShmBuffer(QWaylandDisplay *display, +- const QSize &size, QImage::Format format, int scale = 1); ++ const QSize &size, QImage::Format format, qreal scale = 1); + ~QWaylandShmBuffer() override; + QSize size() const override { return mImage.size(); } + int scale() const override { return int(mImage.devicePixelRatio()); } +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 5280a9f7..38b10269 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -185,7 +185,7 @@ void QWaylandWindow::initWindow() + // typically be integer 1 (normal-dpi) or 2 (high-dpi). Call set_buffer_scale() + // to inform the compositor that high-resolution buffers will be provided. + if (mDisplay->compositorVersion() >= 3) +- mSurface->set_buffer_scale(scale()); ++ mSurface->set_buffer_scale(mScale); + + if (QScreen *s = window()->screen()) + setOrientationMask(s->orientationUpdateMask()); +@@ -572,9 +572,9 @@ void QWaylandWindow::damage(const QRect &rect) + if (mSurface == nullptr) + return; + +- const int s = scale(); ++ const qreal s = scale(); + if (mDisplay->compositorVersion() >= 4) +- mSurface->damage_buffer(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height()); ++ mSurface->damage_buffer(qFloor(s * rect.x()), qFloor(s * rect.y()), qCeil(s * rect.width()), qCeil(s * rect.height())); + else + mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); + } +@@ -613,9 +613,9 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage) + + attachOffset(buffer); + if (mDisplay->compositorVersion() >= 4) { +- const int s = scale(); ++ const qreal s = scale(); + for (const QRect &rect: damage) +- mSurface->damage_buffer(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height()); ++ mSurface->damage_buffer(qFloor(s * rect.x()), qFloor(s * rect.y()), qCeil(s * rect.width()), qCeil(s * rect.height())); + } else { + for (const QRect &rect: damage) + mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); +@@ -1106,14 +1106,14 @@ bool QWaylandWindow::isActive() const + return mDisplay->isWindowActivated(this); + } + +-int QWaylandWindow::scale() const ++qreal QWaylandWindow::scale() const + { +- return mScale; ++ return devicePixelRatio(); + } + + qreal QWaylandWindow::devicePixelRatio() const + { +- return mScale; ++ return qreal(mScale); + } + + bool QWaylandWindow::setMouseGrabEnabled(bool grab) +diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h +index 2f219d8c..741f9e5c 100644 +--- a/src/client/qwaylandwindow_p.h ++++ b/src/client/qwaylandwindow_p.h +@@ -158,7 +158,7 @@ public: + + void setMask(const QRegion ®ion) override; + +- int scale() const; ++ qreal scale() const; + qreal devicePixelRatio() const override; + + void requestActivateWindow() override; +diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +index c1f45fa6..bbc63444 100644 +--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp ++++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +@@ -195,7 +195,7 @@ public: + QOpenGLTextureCache *cache = QOpenGLTextureCache::cacheForContext(m_context->context()); + + QSize surfaceSize = window->surfaceSize(); +- int scale = window->scale() ; ++ qreal scale = window->scale() ; + glViewport(0, 0, surfaceSize.width() * scale, surfaceSize.height() * scale); + + //Draw Decoration +-- +2.46.0 + diff --git a/SOURCES/0050-Client-Fix-buffer-damage.patch b/SOURCES/0050-Client-Fix-buffer-damage.patch new file mode 100644 index 0000000..9f2fd04 --- /dev/null +++ b/SOURCES/0050-Client-Fix-buffer-damage.patch @@ -0,0 +1,71 @@ +From 94a8ee2ce3a471753f96ede7751528f8f7f83719 Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Thu, 3 Aug 2023 12:28:44 +0300 +Subject: [PATCH 50/59] Client: Fix buffer damage + +If the specified damage rectangle has fractional coordinates in the buffer +local coordinate space, the buffer damage needs to be expanded, i.e. + +- bufferRect.left = floor(rect.left * scale) +- bufferRect.right = ceil(rect.right * scale) = ceil((rect.x + rect.width) * scale) + +Flooring the coordinates and ceiling the size is not enough. It can +produce incorrect results. + +For example, consider that a rectangle with logical coordinates of +QRect(0, 23, 179, 46) has been damaged in a window with scale 1.5. When +flooring the coordinates and ceiling the size, the following buffer +damage rect will be produced: QRect(0, 34, 269, 69). Its height is off by +1, the expected height is 70 (ceil((23 + 46) * 1.5) - floor(23 * 1.5) = +ceil(103.5) - floor(34.5) = 104 - 34 = 70). + +Pick-to: 5.15 6.5 6.6 +Change-Id: I927e75a2224bb58b4634125011d1305dbdfbb3aa +Reviewed-by: David Edmundson +(cherry picked from commit d79db699866b37bd3e3358ca18a210dfc5c0b4b9) +--- + src/client/qwaylandwindow.cpp | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 38b10269..5d01507d 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -573,10 +573,15 @@ void QWaylandWindow::damage(const QRect &rect) + return; + + const qreal s = scale(); +- if (mDisplay->compositorVersion() >= 4) +- mSurface->damage_buffer(qFloor(s * rect.x()), qFloor(s * rect.y()), qCeil(s * rect.width()), qCeil(s * rect.height())); +- else ++ if (mDisplay->compositorVersion() >= 4) { ++ const QRect bufferRect = ++ QRectF(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height()) ++ .toAlignedRect(); ++ mSurface->damage_buffer(bufferRect.x(), bufferRect.y(), bufferRect.width(), ++ bufferRect.height()); ++ } else { + mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); ++ } + } + + void QWaylandWindow::safeCommit(QWaylandBuffer *buffer, const QRegion &damage) +@@ -614,8 +619,13 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage) + attachOffset(buffer); + if (mDisplay->compositorVersion() >= 4) { + const qreal s = scale(); +- for (const QRect &rect: damage) +- mSurface->damage_buffer(qFloor(s * rect.x()), qFloor(s * rect.y()), qCeil(s * rect.width()), qCeil(s * rect.height())); ++ for (const QRect &rect : damage) { ++ const QRect bufferRect = ++ QRectF(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height()) ++ .toAlignedRect(); ++ mSurface->damage_buffer(bufferRect.x(), bufferRect.y(), bufferRect.width(), ++ bufferRect.height()); ++ } + } else { + for (const QRect &rect: damage) + mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); +-- +2.46.0 + diff --git a/SOURCES/0051-Client-Commit-the-initial-surface-state-explicitly.patch b/SOURCES/0051-Client-Commit-the-initial-surface-state-explicitly.patch new file mode 100644 index 0000000..24088da --- /dev/null +++ b/SOURCES/0051-Client-Commit-the-initial-surface-state-explicitly.patch @@ -0,0 +1,37 @@ +From 967e6ceca9e16cf5a5e92d63958057f84a1b54fd Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Fri, 25 Aug 2023 10:19:07 +0300 +Subject: [PATCH 51/59] Client: Commit the initial surface state explicitly + +QWaylandWindow lacks an explicit step to finish initializing the shell +surface by committing the surface. So far it used to work because of +hidden surface commits in +QWaylandWindow::handleContentOrientationChange(), +QWaylandWindow::setMask() and so on. + +This change adds an explicit step to commit the initial surface state to +make the shell surface initialization robust. + +Change-Id: Ibc38a4e0dbea689a727451c25a61af0270c7e548 +Reviewed-by: David Edmundson +(cherry picked from commit 225432c2294bdfbf24856b2f155cd274b24543b2) +--- + src/client/qwaylandwindow.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 5d01507d..5eee0414 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -200,6 +200,8 @@ void QWaylandWindow::initWindow() + mShellSurface->requestWindowStates(window()->windowStates()); + handleContentOrientationChange(window()->contentOrientation()); + mFlags = window()->flags(); ++ ++ mSurface->commit(); + } + + void QWaylandWindow::initializeWlSurface() +-- +2.46.0 + diff --git a/SOURCES/0052-tests-Fix-tst_xdgshell-minMaxSize.patch b/SOURCES/0052-tests-Fix-tst_xdgshell-minMaxSize.patch new file mode 100644 index 0000000..cf0cb4e --- /dev/null +++ b/SOURCES/0052-tests-Fix-tst_xdgshell-minMaxSize.patch @@ -0,0 +1,35 @@ +From aa865b7cc8f38bd8ad4a5a0cb75effa1e7dbc9ed Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Fri, 15 Sep 2023 10:06:32 +0300 +Subject: [PATCH 52/59] tests: Fix tst_xdgshell::minMaxSize() + +Amends e8cff6fb39c0fd01548bce18542820a6612dbe49. + +The new size hints will be committed when the surface is committed. + +Change-Id: I94e944fee7dac63d5e9ac86fb348b5d24d54abfc +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit d8d3d6097afeac62f1b0285e3d5365c7cb580547) +--- + tests/auto/client/xdgshell/tst_xdgshell.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp +index c5271f63..f2181fd6 100644 +--- a/tests/auto/client/xdgshell/tst_xdgshell.cpp ++++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp +@@ -604,9 +604,11 @@ void tst_xdgshell::minMaxSize() + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(1000, 1000)); + + window.setMaximumSize(QSize(500, 400)); ++ window.update(); + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(500, 400)); + + window.setMinimumSize(QSize(50, 40)); ++ window.update(); + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(50, 40)); + } + +-- +2.46.0 + diff --git a/SOURCES/0053-Client-Manage-QMimeData-lifecycle.patch b/SOURCES/0053-Client-Manage-QMimeData-lifecycle.patch deleted file mode 100644 index 4941d36..0000000 --- a/SOURCES/0053-Client-Manage-QMimeData-lifecycle.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 31eab11d3b6697a76cc7802d02e525c1152a42c2 Mon Sep 17 00:00:00 2001 -From: Tang Haixiang -Date: Thu, 22 Dec 2022 15:19:53 +0800 -Subject: [PATCH 53/55] 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 -Reviewed-by: Qt CI Bot -(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(-) - -diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp -index 81f48e05..14561c77 100644 ---- 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 -diff --git a/src/client/qwaylandclipboard_p.h b/src/client/qwaylandclipboard_p.h -index ce14e124..bb52683d 100644 ---- 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]; - }; - - } -diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp -index 5599cbd4..e085152c 100644 ---- 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(); -diff --git a/src/client/qwaylanddatasource_p.h b/src/client/qwaylanddatasource_p.h -index 96f07bc3..14d1542d 100644 ---- 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(); --- -2.40.0 - diff --git a/SOURCES/0053-Client-Remove-some-surface-commits.patch b/SOURCES/0053-Client-Remove-some-surface-commits.patch new file mode 100644 index 0000000..2a4ddf1 --- /dev/null +++ b/SOURCES/0053-Client-Remove-some-surface-commits.patch @@ -0,0 +1,62 @@ +From 39defe8fdbaed15868bd3fdbf4a1ae638b770753 Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Fri, 25 Aug 2023 10:15:29 +0300 +Subject: [PATCH 53/59] Client: Remove some surface commits + +The buffer transform, input and opaque regions are double buffered +state. They will be applied on the next surface commit. + +But the issue with them is that the relevant code makes surface commits +too. It's undesired as it can lead to qtwayland committing partial +state, for example it can break xdg surface window geometry. + +This change removes hidden surface commits. The relevant properties will +be applied on the next frame. + +Change-Id: I1c40c9a5430fb6b91d7643b20d628f8a9a9d501a +Reviewed-by: David Edmundson +(cherry picked from commit e8cff6fb39c0fd01548bce18542820a6612dbe49) +--- + src/client/qwaylandwindow.cpp | 4 ---- + src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 3 --- + 2 files changed, 7 deletions(-) + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 5eee0414..7a9bccc1 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -478,8 +478,6 @@ void QWaylandWindow::setMask(const QRegion &mask) + if (isOpaque()) + setOpaqueArea(mMask); + } +- +- mSurface->commit(); + } + + void QWaylandWindow::applyConfigureWhenPossible() +@@ -794,8 +792,6 @@ void QWaylandWindow::handleContentOrientationChange(Qt::ScreenOrientation orient + Q_UNREACHABLE(); + } + mSurface->set_buffer_transform(transform); +- // set_buffer_transform is double buffered, we need to commit. +- mSurface->commit(); + } + + void QWaylandWindow::setOrientationMask(Qt::ScreenOrientations mask) +diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +index 2cc36510..535c3398 100644 +--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp ++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +@@ -367,9 +367,6 @@ bool QWaylandXdgSurface::wantsDecorations() const + void QWaylandXdgSurface::propagateSizeHints() + { + setSizeHints(); +- +- if (m_toplevel && m_window) +- m_window->commit(); + } + + void QWaylandXdgSurface::setWindowGeometry(const QRect &rect) +-- +2.46.0 + diff --git a/SOURCES/0054-Client-Avoid-locking-resizing-in-QWaylandShmBackingS.patch b/SOURCES/0054-Client-Avoid-locking-resizing-in-QWaylandShmBackingS.patch new file mode 100644 index 0000000..0ff851a --- /dev/null +++ b/SOURCES/0054-Client-Avoid-locking-resizing-in-QWaylandShmBackingS.patch @@ -0,0 +1,69 @@ +From 14a03df4e97188a4401e6e0cf335b13e7591ed30 Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Wed, 30 Aug 2023 09:49:41 +0300 +Subject: [PATCH 54/59] Client: Avoid locking resizing in + QWaylandShmBackingStore + +QWaylandWindow::setCanResize(false) will block applying configure +events. QWaylandWindow::setCanResize(true) will unblock configure events +and potentially apply a scheduled configure event if there's one. + +QWaylandWindow::setCanResize(true) has to be called **after** committing +the surface to ensure that the xdg window geometry matches the buffer. +We don't want the xdg window geometry change when painting. + +Unfortunately, setCanResize(true) can be called before the surface is +committed when using a RasterSurface, for example + + - QWaylandShmBackingStore::beginPaint(): calls setCanResize(false) + - QWaylandShmBackingStore::endPaint(): calls setCanResize(true) + - QWaylandWindow::setCanResize(true): applies pending configure event + - QWaylandShmBackingStore::flush(): commits the surface, but the xdg + window geometry is wrong now + +As is, beginPaint() and endPaint() are not entirely correct functions +where configure events can be blocked. We need functions that wrap both +painting and flushing, which are not feasible with the current backing +store design. + +On the other hand, it's worth noting that blocking configure events in +the backing store is not necessary because painting happens on the main +thread unlike OpenGL or Vulkan code paths. + +Given the lack of synchronization points and the fact that rendering +happens on the main thread, this change removes blocking configure +events in QWaylandShmBackingStore. It fixes dolphin and various other +applications that use QtWidgets jumping while being interactively +resized. + +Change-Id: I156e4fd5e04a6bba7e8d48171510d5ab0ec89713 +Reviewed-by: David Edmundson +(cherry picked from commit 8828452bcf2ecf4e02a64380a1697d148c4366b0) +--- + src/client/qwaylandshmbackingstore.cpp | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp +index 90e37e95..145f933b 100644 +--- a/src/client/qwaylandshmbackingstore.cpp ++++ b/src/client/qwaylandshmbackingstore.cpp +@@ -186,8 +186,6 @@ void QWaylandShmBackingStore::beginPaint(const QRegion ®ion) + mPainting = true; + ensureSize(); + +- waylandWindow()->setCanResize(false); +- + if (mBackBuffer->image()->hasAlphaChannel()) { + QPainter p(paintDevice()); + p.setCompositionMode(QPainter::CompositionMode_Source); +@@ -202,7 +200,6 @@ void QWaylandShmBackingStore::endPaint() + mPainting = false; + if (mPendingFlush) + flush(window(), mPendingRegion, QPoint()); +- waylandWindow()->setCanResize(true); + } + + void QWaylandShmBackingStore::ensureSize() +-- +2.46.0 + diff --git a/SOURCES/0054-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch b/SOURCES/0054-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch deleted file mode 100644 index 2d7ba8a..0000000 --- a/SOURCES/0054-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 18c2bcec31f68aafd66d7ec503ec6511ca804d07 Mon Sep 17 00:00:00 2001 -From: Aleix Pol -Date: Mon, 6 Mar 2023 01:11:45 +0100 -Subject: [PATCH 54/55] 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 -Reviewed-by: David Edmundson -(cherry picked from commit a53f022393a1276dbf8eccbae04cb0bd6cea0160) ---- - src/client/qwaylandnativeinterface.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp -index bf54a1a0..9763c312 100644 ---- 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; --- -2.40.0 - diff --git a/SOURCES/0055-Client-Always-populate-mimedata-in-drags.patch b/SOURCES/0055-Client-Always-populate-mimedata-in-drags.patch new file mode 100644 index 0000000..abbd97a --- /dev/null +++ b/SOURCES/0055-Client-Always-populate-mimedata-in-drags.patch @@ -0,0 +1,52 @@ +From b036434381a3e8d543f4e9de8c28fb0a8770cfec Mon Sep 17 00:00:00 2001 +From: David Edmundson +Date: Wed, 17 May 2023 09:06:03 +0300 +Subject: [PATCH 55/59] Client: Always populate mimedata in drags + +It's possible for clients to perform a drag and drop operation within +their own client without any mimeData. A user can directly access the +original drag. + +On wayland without any mimedata it's impossible for a client to accept a +drag as the mechansim involved is to either select a given mimedata +entry or an empty string. Within Qt we always accept the first format if +we accept a drag. + +When dragging within our own window we also start a wayland drag so will +receive a cancel event from the compositor if the compositor doesn't +believe the client has accepted the drag. + +This patch provides a dummy mimedata entry so that something can be +accepted. + +Fixes: QTBUG-112161 +Pick-to: 6.6 6.5 6.2 5.15 +Change-Id: I6309d82e20545e10ebdb9dafde7e13a5e3be5ff2 +Reviewed-by: Liang Qi +(cherry picked from commit 32fedb6fa6579711b6cb192a2e3cfb7ad1264546) + +* asturmlechner 2023-10-24: Backported L1 literal as QString::fromLatin1 +--- + src/client/qwaylanddatadevice.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp +index 9c3308d5..07b18ab0 100644 +--- a/src/client/qwaylanddatadevice.cpp ++++ b/src/client/qwaylanddatadevice.cpp +@@ -124,6 +124,12 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supporte + return false; + } + ++ // dragging data without mimetypes is a legal operation in Qt terms ++ // but Wayland uses a mimetype to determine if a drag is accepted or not ++ // In this rare case, insert a placeholder ++ if (mimeData->formats().isEmpty()) ++ mimeData->setData(QString::fromLatin1("application/x-qt-avoid-empty-placeholder"), QByteArray("1")); ++ + m_dragSource.reset(new QWaylandDataSource(m_display->dndSelectionHandler(), mimeData)); + + if (wl_data_device_get_version(object()) >= 3) +-- +2.46.0 + diff --git a/SOURCES/0055-Client-Remove-flip-popup-constraints.patch b/SOURCES/0055-Client-Remove-flip-popup-constraints.patch deleted file mode 100644 index a51fad7..0000000 --- a/SOURCES/0055-Client-Remove-flip-popup-constraints.patch +++ /dev/null @@ -1,41 +0,0 @@ -From c4c3fc69250c01cb35aaae5ea1ea2bcc8236dff0 Mon Sep 17 00:00:00 2001 -From: Vlad Zahorodnii -Date: Thu, 12 Jan 2023 14:49:25 +0200 -Subject: [PATCH 55/55] 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 -(cherry picked from commit d7a5dab0182cba19d7f59e542672aa3d1b2e859e) ---- - src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index ad666129..822b385c 100644 ---- 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(); - --- -2.40.0 - diff --git a/SOURCES/0056-Client-Fix-enter-event-cursor-position-with-xdg-popu.patch b/SOURCES/0056-Client-Fix-enter-event-cursor-position-with-xdg-popu.patch new file mode 100644 index 0000000..f90d4e4 --- /dev/null +++ b/SOURCES/0056-Client-Fix-enter-event-cursor-position-with-xdg-popu.patch @@ -0,0 +1,60 @@ +From 7d288c916311a70b16c3a310b7a36862ce4c2268 Mon Sep 17 00:00:00 2001 +From: Ilya Fedin +Date: Sun, 3 Dec 2023 19:12:03 +0400 +Subject: [PATCH 56/59] Client: Fix enter event cursor position with xdg-popup + and QHighDpiScaling + +QWindowSystemInterface::handleEnterEvent accepts device-dependent +position while QCursor::pos provides device-independent position. + +Use QWaylandCursor::pos instead. + +Pick-to: 6.6 6.5 6.2 5.15 +Change-Id: I70d2997610f7a34c6763bd4f10f20a65c3debdbe +Reviewed-by: David Edmundson +(cherry picked from commit 8e57e8b51b2b701c5520f37b7d78de5b3c488500) +--- + .../shellintegration/xdg-shell/qwaylandxdgshell.cpp | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +index 535c3398..9c6cbb81 100644 +--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp ++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -229,8 +230,10 @@ QWaylandXdgSurface::Popup::~Popup() + leave = m_xdgSurface->window()->window(); + QWindowSystemInterface::handleLeaveEvent(leave); + +- if (QWindow *enter = QGuiApplication::topLevelAt(QCursor::pos())) +- QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos()); ++ if (QWindow *enter = QGuiApplication::topLevelAt(QCursor::pos())) { ++ const auto pos = m_xdgSurface->window()->display()->waylandCursor()->pos(); ++ QWindowSystemInterface::handleEnterEvent(enter, enter->handle()->mapFromGlobal(pos), pos); ++ } + } + } + +@@ -462,8 +465,10 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic + if (m_popup && m_popup->m_xdgSurface && m_popup->m_xdgSurface->window()) + enter = m_popup->m_xdgSurface->window()->window(); + +- if (enter) +- QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos()); ++ if (enter) { ++ const auto pos = m_popup->m_xdgSurface->window()->display()->waylandCursor()->pos(); ++ QWindowSystemInterface::handleEnterEvent(enter, enter->handle()->mapFromGlobal(pos), pos); ++ } + } + + void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) +-- +2.46.0 + diff --git a/SOURCES/0057-client-don-t-cache-one-type-in-QWaylandMimeData.patch b/SOURCES/0057-client-don-t-cache-one-type-in-QWaylandMimeData.patch new file mode 100644 index 0000000..03f3cea --- /dev/null +++ b/SOURCES/0057-client-don-t-cache-one-type-in-QWaylandMimeData.patch @@ -0,0 +1,47 @@ +From 7007e9aa55fbb292a225fee83ef647c1b37509be Mon Sep 17 00:00:00 2001 +From: Liang Qi +Date: Wed, 13 Mar 2024 11:53:58 +0100 +Subject: [PATCH 57/59] client: don't cache one type in QWaylandMimeData + +"application/vnd.portal.filetransfer", which is only valid for one +time use. + +Fixes: QTBUG-107858 +Pick-to: 6.7 6.6 6.5 6.2 5.15 +Change-Id: I094de22ea0bb9b3577572e6c57ebe42cdc8c7b41 +Reviewed-by: David Edmundson +(cherry picked from commit 19758eb4093e8d60c69f75174afb7457490e2332) +--- + src/client/qwaylanddataoffer.cpp | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp +index fe0ea8c9..0241a1df 100644 +--- a/src/client/qwaylanddataoffer.cpp ++++ b/src/client/qwaylanddataoffer.cpp +@@ -56,6 +56,11 @@ static QString utf8Text() + return QStringLiteral("text/plain;charset=utf-8"); + } + ++static QString portalFileTransfer() ++{ ++ return QStringLiteral("application/vnd.portal.filetransfer"); ++} ++ + QWaylandDataOffer::QWaylandDataOffer(QWaylandDisplay *display, struct ::wl_data_offer *offer) + : QtWayland::wl_data_offer(offer) + , m_display(display) +@@ -182,7 +187,9 @@ QVariant QWaylandMimeData::retrieveData_sys(const QString &mimeType, QVariant::T + } + + close(pipefd[0]); +- m_data.insert(mimeType, content); ++ if (mimeType != portalFileTransfer()) ++ m_data.insert(mimeType, content); ++ + return content; + } + +-- +2.46.0 + diff --git a/SOURCES/0058-Fix-race-condition-in-drag-and-drop.patch b/SOURCES/0058-Fix-race-condition-in-drag-and-drop.patch new file mode 100644 index 0000000..eb6b234 --- /dev/null +++ b/SOURCES/0058-Fix-race-condition-in-drag-and-drop.patch @@ -0,0 +1,76 @@ +From e1a146806873879c380486f084a990936c5fa537 Mon Sep 17 00:00:00 2001 +From: Eskil Abrahamsen Blomfeldt +Date: Fri, 10 May 2024 13:20:30 +0200 +Subject: [PATCH 58/59] Fix race condition in drag and drop + +The data source may be deleted by libwayland while we hold a +reference to it. This could cause crashes when dragging +and dropping repeatedly and very rapidly between two +components. + +Tapping into sourceDestroyed() for this as well allows us to +recover more gracefully. + +This also required adding some null pointer checks to the code, +since it wasn't really prepared for the data source +disappearing. + +Pick-to: 5.15 6.2 6.5 6.7 6.8 +Fixes: QTBUG-124502 +Change-Id: Ic3df8bf70176c5424ac5c693f8456f61e7b2762b +Reviewed-by: Paul Olav Tvete +(cherry picked from commit 792bd8510e3bc6b47bcaedfb1386390ce3a10a3a) +--- + src/compositor/wayland_wrapper/qwldatadevice.cpp | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp +index a3a795f9..f301678e 100644 +--- a/src/compositor/wayland_wrapper/qwldatadevice.cpp ++++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp +@@ -76,6 +76,9 @@ void DataDevice::sourceDestroyed(DataSource *source) + { + if (m_selectionSource == source) + m_selectionSource = nullptr; ++ ++ if (m_dragDataSource == source) ++ m_dragDataSource = nullptr; + } + + #if QT_CONFIG(draganddrop) +@@ -105,9 +108,11 @@ void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPositi + if (m_dragDataSource && !offer) + return; + +- send_enter(resource->handle, serial, focus->resource(), +- wl_fixed_from_double(localPosition.x()), wl_fixed_from_double(localPosition.y()), +- offer->resource()->handle); ++ if (offer) { ++ send_enter(resource->handle, serial, focus->resource(), ++ wl_fixed_from_double(localPosition.x()), wl_fixed_from_double(localPosition.y()), ++ offer->resource()->handle); ++ } + + m_dragFocus = focus; + m_dragFocusResource = resource; +@@ -139,7 +144,7 @@ void DataDevice::drop() + if (m_dragFocusResource) { + send_drop(m_dragFocusResource->handle); + setDragFocus(nullptr, QPoint()); +- } else { ++ } else if (m_dragDataSource) { + m_dragDataSource->cancel(); + } + m_dragOrigin = nullptr; +@@ -155,6 +160,8 @@ void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource + { + m_dragClient = resource->client(); + m_dragDataSource = source ? DataSource::fromResource(source) : nullptr; ++ if (m_dragDataSource) ++ m_dragDataSource->setDevice(this); + m_dragOrigin = QWaylandSurface::fromResource(origin); + QWaylandDrag *drag = m_seat->drag(); + setDragIcon(icon ? QWaylandSurface::fromResource(icon) : nullptr); +-- +2.46.0 + diff --git a/SOURCES/0059-Revert-Client-Send-release-button-event-on-pointer-l.patch b/SOURCES/0059-Revert-Client-Send-release-button-event-on-pointer-l.patch new file mode 100644 index 0000000..41adff6 --- /dev/null +++ b/SOURCES/0059-Revert-Client-Send-release-button-event-on-pointer-l.patch @@ -0,0 +1,75 @@ +From 6b1ba1cd0e1389d13e59b94e65da8f20a89ba03f Mon Sep 17 00:00:00 2001 +From: Liang Qi +Date: Wed, 6 Sep 2023 11:04:02 +0200 +Subject: [PATCH 59/59] Revert "Client: Send release button event on pointer + leave" + +This reverts commit 8235fa65fe033a94e7a44322d3502f25940092ec. + +It makes tests/manual/examples/widgets/draganddrop/puzzle not work, +which does drag and drop in same app. + +Pick-to: 6.6 6.5 6.2 5.15 +Fixes: QTBUG-115757 +Task-number: QTBUG-97037 +Change-Id: I738769fde96f7da91f5bc4dc7a70ed49596dcd61 +Reviewed-by: Liang Qi +(cherry picked from commit 60647fa069ef4143642ae4c1b529ad2a7a7f2fd9) +--- + src/client/qwaylandinputdevice.cpp | 9 ++------- + src/client/qwaylandinputdevice_p.h | 1 - + 2 files changed, 2 insertions(+), 8 deletions(-) + +diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp +index 74f16b70..ab978d3f 100644 +--- a/src/client/qwaylandinputdevice.cpp ++++ b/src/client/qwaylandinputdevice.cpp +@@ -688,8 +688,8 @@ public: + + void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surface *surface) + { +- releaseButtons(); + invalidateFocus(); ++ mButtons = Qt::NoButton; + + mParent->mTime = time; + +@@ -804,8 +804,6 @@ void QWaylandInputDevice::Pointer::pointer_button(uint32_t serial, uint32_t time + default: return; // invalid button number (as far as Qt is concerned) + } + +- mLastButton = qt_button; +- + if (state) + mButtons |= qt_button; + else +@@ -844,13 +842,10 @@ void QWaylandInputDevice::Pointer::invalidateFocus() + + void QWaylandInputDevice::Pointer::releaseButtons() + { +- if (mButtons == Qt::NoButton) +- return; +- + mButtons = Qt::NoButton; + + if (auto *window = focusWindow()) { +- ReleaseEvent e(focusWindow(), mParent->mTime, mSurfacePos, mGlobalPos, mButtons, mLastButton, mParent->modifiers()); ++ ReleaseEvent e(focusWindow(), mParent->mTime, mSurfacePos, mGlobalPos, mButtons, Qt::NoButton, mParent->modifiers()); + window->handleMouse(mParent, e); + } + } +diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h +index bafe3db2..5795f138 100644 +--- a/src/client/qwaylandinputdevice_p.h ++++ b/src/client/qwaylandinputdevice_p.h +@@ -346,7 +346,6 @@ public: + QPointF mSurfacePos; + QPointF mGlobalPos; + Qt::MouseButtons mButtons = Qt::NoButton; +- Qt::MouseButton mLastButton = Qt::NoButton; + #if QT_CONFIG(cursor) + wl_buffer *mCursorBuffer = nullptr; + Qt::CursorShape mCursorShape = Qt::BitmapCursor; +-- +2.46.0 + diff --git a/SOURCES/qtwayland-client-fix-window-margin-calculation.patch b/SOURCES/qtwayland-client-fix-window-margin-calculation.patch new file mode 100644 index 0000000..49b21e9 --- /dev/null +++ b/SOURCES/qtwayland-client-fix-window-margin-calculation.patch @@ -0,0 +1,29 @@ +From e6634936ab661a9b6303d1318392ea109a17dad4 Mon Sep 17 00:00:00 2001 +From: Rob Hall +Date: Sun, 24 Dec 2023 21:46:48 +0000 +Subject: [PATCH] client: Fix window margin calculation + +Don't subtract the size of the window frame margin from the content +area. Fixes an issue where an area of the window is unclickable when +client-side decorations are in use. + +Fixes: QTBUG-120392 +Pick-to: 6.7 6.6 6.5 +Change-Id: I6a89b2d463be084233ea3448cacfbbd09d66b96e +--- + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 610cc9e..bb71638 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -1360,8 +1360,8 @@ + QMargins marg = frameMargins(); + QRect windowRect(0 + marg.left(), + 0 + marg.top(), +- geometry().size().width() - marg.right(), +- geometry().size().height() - marg.bottom()); ++ geometry().size().width(), ++ geometry().size().height()); + if (windowRect.contains(e.local.toPoint()) || mMousePressedInContentArea != Qt::NoButton) { + const QPointF localTranslated = mapFromWlSurface(e.local); + QPointF globalTranslated = e.global; diff --git a/SOURCES/qtwayland-client-expose-toplevel-window-state.patch b/SOURCES/qtwayland-decoration-support-backports-from-qt6.patch similarity index 57% rename from SOURCES/qtwayland-client-expose-toplevel-window-state.patch rename to SOURCES/qtwayland-decoration-support-backports-from-qt6.patch index 7823473..56e2ea6 100644 --- a/SOURCES/qtwayland-client-expose-toplevel-window-state.patch +++ b/SOURCES/qtwayland-decoration-support-backports-from-qt6.patch @@ -1,33 +1,69 @@ -From d533901938a996367d7b6f87b0214f5a17098aed Mon Sep 17 00:00:00 2001 -From: Jan Grulich -Date: Tue, 23 Mar 2021 16:03:22 +0100 -Subject: [PATCH] Client: expose toplevel window state - -QWaylandWindow has only basic information about window state, like if -it's active or maximized, but it has no information about tiling, which -can be useful for client-side decorations. We also need to bump version -of xdg-shell protocol we support, because additional states are not in -the version currently supported by QtWayland. It shouldn't be a problem -to increase the version as the new version adds just these additional -window states. - -Change-Id: I4c46516d9c7296c69ea51a022b3bdb4ca06bef8d -Reviewed-by: David Edmundson ---- - src/client/qwaylandwindow.cpp | 15 +++++++++++++++ - src/client/qwaylandwindow_p.h | 16 ++++++++++++++++ - .../xdg-shell/qwaylandxdgshell.cpp | 16 +++++++++++++++- - .../xdg-shell/qwaylandxdgshell_p.h | 3 ++- - 4 files changed, 48 insertions(+), 2 deletions(-) - +diff --git a/src/client/qwaylandabstractdecoration_p.h b/src/client/qwaylandabstractdecoration_p.h +index 81c8e17..61cbde7 100644 +--- a/src/client/qwaylandabstractdecoration_p.h ++++ b/src/client/qwaylandabstractdecoration_p.h +@@ -82,6 +82,12 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandAbstractDecoration : public QObject + Q_OBJECT + Q_DECLARE_PRIVATE(QWaylandAbstractDecoration) + public: ++ enum MarginsType { ++ Full, ++ ShadowsExcluded, ++ ShadowsOnly ++ }; ++ + QWaylandAbstractDecoration(); + ~QWaylandAbstractDecoration() override; + +@@ -91,7 +97,8 @@ public: + void update(); + bool isDirty() const; + +- virtual QMargins margins() const = 0; ++ virtual QMargins margins(MarginsType marginsType = Full) const = 0; ++ + QWindow *window() const; + const QImage &contentImage(); + diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index ba881cb..a1e891d 100644 +index ec232cd..54b27f1 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp -@@ -1089,6 +1089,16 @@ Qt::WindowStates QWaylandWindow::windowStates() const +@@ -383,6 +383,16 @@ void QWaylandWindow::setGeometry(const QRect &r) + void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset) + { + QMargins margins = frameMargins(); ++ ++ // Exclude shadows from margins once they are excluded from window geometry ++ // 1) First resizeFromApplyConfigure() call will have sizeWithMargins equal to surfaceSize() ++ // which has full margins (shadows included). ++ // 2) Following resizeFromApplyConfigure() calls should have sizeWithMargins equal to ++ // windowContentGeometry() which excludes shadows, therefore in this case we have to ++ // exclude them too in order not to accidentally apply smaller size to the window. ++ if (mWindowDecoration && (sizeWithMargins != surfaceSize())) ++ margins = mWindowDecoration->margins(QWaylandAbstractDecoration::ShadowsExcluded); ++ + int widthWithoutMargins = qMax(sizeWithMargins.width() - (margins.left() + margins.right()), 1); + int heightWithoutMargins = qMax(sizeWithMargins.height() - (margins.top() + margins.bottom()), 1); + QRect geometry(windowGeometry().topLeft(), QSize(widthWithoutMargins, heightWithoutMargins)); +@@ -710,7 +720,12 @@ QSize QWaylandWindow::surfaceSize() const + */ + QRect QWaylandWindow::windowContentGeometry() const + { +- return QRect(QPoint(), surfaceSize()); ++ QMargins shadowMargins; ++ ++ if (mWindowDecoration) ++ shadowMargins = mWindowDecoration->margins(QWaylandAbstractDecoration::ShadowsOnly); ++ ++ return QRect(QPoint(shadowMargins.left(), shadowMargins.top()), surfaceSize().shrunkBy(shadowMargins)); + } + + /*! +@@ -1111,6 +1126,16 @@ Qt::WindowStates QWaylandWindow::windowStates() const return mLastReportedWindowStates; } - + +QWaylandWindow::ToplevelWindowTilingStates QWaylandWindow::toplevelWindowTilingStates() const +{ + return mLastReportedToplevelWindowTilingStates; @@ -42,13 +78,13 @@ index ba881cb..a1e891d 100644 { createDecoration(); diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h -index e068796..f4e5d3d 100644 +index 1907f10..33a3b83 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -95,6 +95,15 @@ public: Vulkan }; - + + enum ToplevelWindowTilingState { + WindowNoState = 0, + WindowTiledLeft = 1, @@ -60,52 +96,78 @@ index e068796..f4e5d3d 100644 + QWaylandWindow(QWindow *window, QWaylandDisplay *display); ~QWaylandWindow() override; - -@@ -145,6 +154,9 @@ public: + +@@ -148,6 +157,9 @@ public: void handleContentOrientationChange(Qt::ScreenOrientation orientation) override; void setOrientationMask(Qt::ScreenOrientations mask); - + + ToplevelWindowTilingStates toplevelWindowTilingStates() const; + void handleToplevelWindowTilingStatesChanged(ToplevelWindowTilingStates states); + void setWindowState(Qt::WindowStates states) override; void setWindowFlags(Qt::WindowFlags flags) override; void handleWindowStatesChanged(Qt::WindowStates states); -@@ -257,6 +269,7 @@ protected: +@@ -260,6 +272,7 @@ protected: QRegion mMask; QRegion mOpaqueArea; Qt::WindowStates mLastReportedWindowStates = Qt::WindowNoState; + ToplevelWindowTilingStates mLastReportedToplevelWindowTilingStates = WindowNoState; - + QWaylandShmBackingStore *mBackingStore = nullptr; QWaylandBuffer *mQueuedBuffer = nullptr; -@@ -293,6 +306,8 @@ private: +@@ -296,6 +309,8 @@ private: friend class QWaylandSubSurface; }; - + +Q_DECLARE_OPERATORS_FOR_FLAGS(QWaylandWindow::ToplevelWindowTilingStates) + inline QIcon QWaylandWindow::windowIcon() const { return mWindowIcon; +diff --git a/src/plugins/decorations/bradient/main.cpp b/src/plugins/decorations/bradient/main.cpp +index e75fda3..72dda67 100644 +--- a/src/plugins/decorations/bradient/main.cpp ++++ b/src/plugins/decorations/bradient/main.cpp +@@ -72,7 +72,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandBradientDecoration : public QWaylandAbstra + public: + QWaylandBradientDecoration(); + protected: +- QMargins margins() const override; ++ QMargins margins(MarginsType marginsType = Full) const override; + void paint(QPaintDevice *device) override; + bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods) override; + bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods) override; +@@ -129,8 +129,11 @@ QRectF QWaylandBradientDecoration::minimizeButtonRect() const + (margins().top() - BUTTON_WIDTH) / 2, BUTTON_WIDTH, BUTTON_WIDTH); + } + +-QMargins QWaylandBradientDecoration::margins() const ++QMargins QWaylandBradientDecoration::margins(MarginsType marginsType) const + { ++ if (marginsType == ShadowsOnly) ++ return QMargins(); ++ + return QMargins(3, 30, 3, 3); + } + diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index d7d0ddf..2c6e84b 100644 +index 2666df2..8d8ac85 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -88,6 +88,7 @@ void QWaylandXdgSurface::Toplevel::applyConfigure() && !m_xdgSurface->m_window->display()->isKeyboardAvailable()) m_xdgSurface->m_window->display()->handleWindowDeactivated(m_xdgSurface->m_window); - + + m_xdgSurface->m_window->handleToplevelWindowTilingStatesChanged(m_toplevelStates); m_xdgSurface->m_window->handleWindowStatesChanged(m_pending.states); - + if (m_pending.size.isEmpty()) { @@ -120,6 +121,7 @@ void QWaylandXdgSurface::Toplevel::xdg_toplevel_configure(int32_t width, int32_t size_t numStates = states->size / sizeof(uint32_t); - + m_pending.states = Qt::WindowNoState; + m_toplevelStates = QWaylandWindow::WindowNoState; - + for (size_t i = 0; i < numStates; i++) { switch (xdgStates[i]) { @@ -132,6 +134,18 @@ void QWaylandXdgSurface::Toplevel::xdg_toplevel_configure(int32_t width, int32_t @@ -127,9 +189,9 @@ index d7d0ddf..2c6e84b 100644 default: break; } -@@ -451,7 +465,7 @@ void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) +@@ -458,7 +472,7 @@ void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) } - + QWaylandXdgShell::QWaylandXdgShell(QWaylandDisplay *display, uint32_t id, uint32_t availableVersion) - : QtWayland::xdg_wm_base(display->wl_registry(), id, qMin(availableVersion, 1u)) + : QtWayland::xdg_wm_base(display->wl_registry(), id, qMin(availableVersion, 2u)) @@ -141,26 +203,26 @@ index 0c98be3..d791213 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h @@ -58,6 +58,7 @@ - + #include #include +#include - + #include #include @@ -69,7 +70,6 @@ class QWindow; namespace QtWaylandClient { - + class QWaylandDisplay; -class QWaylandWindow; class QWaylandInputDevice; class QWaylandXdgShell; - + @@ -123,6 +123,7 @@ private: QSize size = {0, 0}; Qt::WindowStates states = Qt::WindowNoState; } m_pending, m_applied; + QWaylandWindow::ToplevelWindowTilingStates m_toplevelStates = QWaylandWindow::WindowNoState; QSize m_normalSize; - + QWaylandXdgSurface *m_xdgSurface = nullptr; diff --git a/SOURCES/qtwayland-use-adwaita-decorations-by-default.patch b/SOURCES/qtwayland-use-adwaita-decorations-by-default.patch new file mode 100644 index 0000000..fc1728c --- /dev/null +++ b/SOURCES/qtwayland-use-adwaita-decorations-by-default.patch @@ -0,0 +1,14 @@ +diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp +index 13bacc9b..7c35003d 100644 +--- a/src/client/qwaylandintegration.cpp ++++ b/src/client/qwaylandintegration.cpp +@@ -88,6 +88,9 @@ QWaylandIntegration::QWaylandIntegration() + + QWaylandWindow::fixedToplevelPositions = + !qEnvironmentVariableIsSet("QT_WAYLAND_DISABLE_FIXED_POSITIONS"); ++ ++ if (!qEnvironmentVariableIsSet("QT_WAYLAND_DECORATION")) ++ qputenv("QT_WAYLAND_DECORATION", "adwaita"); + } + + QWaylandIntegration::~QWaylandIntegration() diff --git a/SPECS/qt5-qtwayland.spec b/SPECS/qt5-qtwayland.spec index eec1a51..e8deb3a 100644 --- a/SPECS/qt5-qtwayland.spec +++ b/SPECS/qt5-qtwayland.spec @@ -1,13 +1,11 @@ %global qt_module qtwayland -%global build_tests 1 - Summary: Qt5 - Wayland platform support and QtCompositor module Name: qt5-%{qt_module} -Version: 5.15.9 +Version: 5.15.15 Release: 1%{?dist} -License: LGPLv3 +License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0 Url: http://www.qt.io %global majmin %(echo %{version} | cut -d. -f1-2) Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submodules/%{qt_module}-everywhere-opensource-src-%{version}.tar.xz @@ -15,7 +13,7 @@ Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submod ## Upstream patches ## repo: https://invent.kde.org/qt/qt/qtwayland ## branch: kde/5.15 -## git format-patch v5.15.8-lts-lgpl +## git format-patch v5.15.15-lts-lgpl Patch1: 0001-Client-Announce-an-output-after-receiving-more-compl.patch Patch2: 0002-Fix-issue-with-repeated-window-size-changes.patch Patch3: 0003-Client-Connect-drags-being-accepted-to-updating-the-.patch @@ -25,56 +23,64 @@ Patch6: 0006-Fix-build.patch Patch7: 0007-Fix-remove-listener.patch Patch8: 0008-Hook-up-queryKeyboardModifers.patch Patch9: 0009-Correctly-detect-if-image-format-is-supported-by-QIm.patch -Patch10: 0010-Client-Don-t-always-recreate-frame-callbacks.patch -Patch11: 0011-Client-Always-destroy-frame-callback-in-the-actual-c.patch -Patch12: 0012-Wayland-client-use-wl_keyboard-to-determine-active-s.patch -Patch13: 0013-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch -Patch14: 0014-Client-Implement-DataDeviceV3.patch -Patch15: 0015-Client-Delay-deletion-of-QDrag-object-until-after-we.patch -Patch16: 0016-Client-Avoid-processing-of-events-when-showing-windo.patch -Patch17: 0017-Handle-registry_global-out-of-constructor.patch -Patch18: 0018-Connect-flushRequest-after-forceRoundTrip.patch -Patch19: 0019-Move-the-wayland-socket-polling-to-a-separate-event-.patch -Patch20: 0020-Client-Remove-mWaitingForUpdateDelivery.patch -Patch21: 0021-client-Simplify-round-trip-behavior.patch -Patch22: 0022-Client-Fix-opaque-region-setter.patch -Patch23: 0023-Use-proper-dependencies-in-compile-tests.patch -Patch24: 0024-Revert-Client-Remove-mWaitingForUpdateDelivery.patch -Patch25: 0025-Fix-race-condition-on-mWaitingForUpdateDelivery.patch -Patch26: 0026-use-poll-2-when-reading-from-clipboard.patch -Patch27: 0027-Reduce-memory-leakage.patch -Patch28: 0028-Fix-build-with-libcxx-missing-array-include.patch -Patch29: 0029-Only-close-popup-in-the-the-hierchary.patch -Patch30: 0030-Build-fixes-for-GCC-11.patch -Patch31: 0031-Check-pointer-for-null-before-use-in-ASSERT.patch -Patch32: 0032-Use-wl_surface.damage_buffer-on-the-client-side.patch -Patch33: 0033-Client-clear-focus-on-touch-cancel.patch -Patch34: 0034-Guard-mResizeDirty-by-the-correctMutex.patch -Patch35: 0035-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch -Patch36: 0036-Fix-compile-tests.patch -Patch37: 0037-Use-CRLF-line-delimiter-for-text-uri-list-data.patch -Patch38: 0038-Avoid-calling-requestUpdate-from-wrong-thread.patch -Patch39: 0039-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch -Patch40: 0040-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch -Patch41: 0041-Client-Ensure-that-wl_surface-lives-as-long-as-qtqui.patch -Patch42: 0042-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch -Patch43: 0043-Revert-Client-Ensure-that-wl_surface-lives-as-long-a.patch -Patch44: 0044-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch -Patch45: 0045-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch -Patch46: 0046-Client-Bump-wl_output-version.patch -Patch47: 0047-Fix-frame-sync-related-to-unprotected-multithread-ac.patch -Patch48: 0048-Client-Handle-zwp_primary_selection_device_manager_v.patch -Patch49: 0049-Fixes-the-build-on-CentOS.patch -Patch50: 0050-client-Avoid-protocol-error-with-invalid-min-max-siz.patch -Patch51: 0051-Client-Fix-handling-of-Qt-BlankCursor.patch -Patch52: 0052-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch -Patch53: 0053-Client-Manage-QMimeData-lifecycle.patch -Patch54: 0054-client-Do-not-cast-placeholder-screens-to-QWaylandSc.patch -Patch55: 0055-Client-Remove-flip-popup-constraints.patch - -# Disable for now, there is a Qt bug making this broken -# Patch102: qtwayland-decoration-support-backports-from-qt6.patch -Patch103: qtwayland-client-expose-toplevel-window-state.patch +Patch10: 0010-Client-Don-t-always-recreate-frame-callbacks.patch +Patch11: 0011-Client-Always-destroy-frame-callback-in-the-actual-c.patch +Patch12: 0012-Wayland-client-use-wl_keyboard-to-determine-active-s.patch +Patch13: 0013-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch +Patch14: 0014-Client-Implement-DataDeviceV3.patch +Patch15: 0015-Client-Delay-deletion-of-QDrag-object-until-after-we.patch +Patch16: 0016-Client-Avoid-processing-of-events-when-showing-windo.patch +Patch17: 0017-Handle-registry_global-out-of-constructor.patch +Patch18: 0018-Connect-flushRequest-after-forceRoundTrip.patch +Patch19: 0019-Move-the-wayland-socket-polling-to-a-separate-event-.patch +Patch20: 0020-Client-Remove-mWaitingForUpdateDelivery.patch +Patch21: 0021-client-Simplify-round-trip-behavior.patch +Patch22: 0022-Client-Fix-opaque-region-setter.patch +Patch23: 0023-Use-proper-dependencies-in-compile-tests.patch +Patch24: 0024-Revert-Client-Remove-mWaitingForUpdateDelivery.patch +Patch25: 0025-Fix-race-condition-on-mWaitingForUpdateDelivery.patch +Patch26: 0026-use-poll-2-when-reading-from-clipboard.patch +Patch27: 0027-Reduce-memory-leakage.patch +Patch28: 0028-Only-close-popup-in-the-the-hierchary.patch +Patch29: 0029-Check-pointer-for-null-before-use-in-ASSERT.patch +Patch30: 0030-Use-wl_surface.damage_buffer-on-the-client-side.patch +Patch31: 0031-Client-clear-focus-on-touch-cancel.patch +Patch32: 0032-Guard-mResizeDirty-by-the-correctMutex.patch +Patch33: 0033-Fix-compile-tests.patch +Patch34: 0034-Call-finishDrag-in-QWaylandDataDevice-dragSourceCanc.patch +Patch35: 0035-Hold-surface-read-lock-throughout-QWaylandEglWindow-.patch +Patch36: 0036-Keep-toplevel-windows-in-the-top-left-corner-of-the-.patch +Patch37: 0037-Client-Add-F_SEAL_SHRINK-seal-to-shm-backing-file.patch +Patch38: 0038-Client-Call-wl_output_release-upon-QWaylandScreen-de.patch +Patch39: 0039-Client-Bump-wl_output-version.patch +Patch40: 0040-Fix-frame-sync-related-to-unprotected-multithread-ac.patch +Patch41: 0041-Client-Handle-zwp_primary_selection_device_manager_v.patch +Patch42: 0042-Fixes-the-build-on-CentOS.patch +Patch43: 0043-client-Avoid-protocol-error-with-invalid-min-max-siz.patch +Patch44: 0044-Client-Fix-handling-of-Qt-BlankCursor.patch +Patch45: 0045-client-Force-a-roundtrip-when-an-XdgOutput-is-not-re.patch +Patch46: 0046-Destroy-frame-queue-before-display.patch +Patch47: 0047-client-Fix-crash-on-dnd-updates-after-client-facing-.patch +Patch48: 0048-Convert-cursor-bitmap-to-supported-format.patch +Patch49: 0049-Replace-scale-with-devicePixelRatio-for-non-integer-.patch +Patch50: 0050-Client-Fix-buffer-damage.patch +Patch51: 0051-Client-Commit-the-initial-surface-state-explicitly.patch +Patch52: 0052-tests-Fix-tst_xdgshell-minMaxSize.patch +Patch53: 0053-Client-Remove-some-surface-commits.patch +Patch54: 0054-Client-Avoid-locking-resizing-in-QWaylandShmBackingS.patch +Patch55: 0055-Client-Always-populate-mimedata-in-drags.patch +Patch56: 0056-Client-Fix-enter-event-cursor-position-with-xdg-popu.patch +Patch57: 0057-client-don-t-cache-one-type-in-QWaylandMimeData.patch +Patch58: 0058-Fix-race-condition-in-drag-and-drop.patch +Patch59: 0059-Revert-Client-Send-release-button-event-on-pointer-l.patch + +# Use QAdwaitaDecorations by default +Patch100: qtwayland-use-adwaita-decorations-by-default.patch +Patch101: qtwayland-decoration-support-backports-from-qt6.patch +Patch102: qtwayland-client-fix-window-margin-calculation.patch + +# Upstreamable patches + # filter qml provides %global __provides_exclude_from ^%{_qt5_archdatadir}/qml/.*\\.so$ @@ -117,14 +123,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %description examples %{summary}. -%if 0%{?build_tests} -%package tests -Summary: Unit tests for %{name} -Requires: %{name}%{?_isa} = %{version}-%{release} - -%description tests -%{summary}. -%endif %prep %autosetup -n %{qt_module}-everywhere-src-%{version} -p1 @@ -135,17 +133,10 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %make_build -%if 0%{?build_tests} -%qt5_build_tests -%endif %install make install INSTALL_ROOT=%{buildroot} -%if 0%{?build_tests} -%qt5_install_tests -%endif - ## .prl/.la file love # nuke .prl reference(s) to %%buildroot, excessive (.la-like) libs pushd %{buildroot}%{_qt5_libdir} @@ -194,62 +185,151 @@ popd %files examples %{_qt5_examplesdir}/wayland/ -%if 0%{?build_tests} -%files tests -%{_qt5_libdir}/qt5/tests -%endif %changelog -* Tue Apr 18 2023 Jan Grulich - 5.15.9-1 +* Mon Jan 06 2025 Arkady L. Shane - 5.15.15-1 +- Rebuilt for MSVSphere 10 + +* Wed Sep 04 2024 Jan Grulich - 5.15.15-1 +- 5.15.15 + +* Fri Jul 19 2024 Fedora Release Engineering - 5.15.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Wed May 29 2024 Jan Grulich - 5.15.14-1 +- 5.15.14 + +* Thu Mar 14 2024 Jan Grulich - 5.15.13-1 +- 5.15.13 + +* Fri Jan 26 2024 Fedora Release Engineering - 5.15.12-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 5.15.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jan 04 2024 Jan Grulich - 5.15.12-2 +- Client: fix window margin calculation + +* Tue Jan 02 2024 Jan Grulich - 5.15.12-1 +- 5.15.12 + +* Fri Oct 06 2023 Jan Grulich - 5.15.11-1 +- 5.15.11 + +* Tue Aug 22 2023 Jan Grulich - 5.15.10-4 +- Rebuild (qtbase) + +* Wed Aug 16 2023 Jan Grulich - 5.15.10-3 +- Use QAdwaitaDecorations by default + +* Fri Jul 21 2023 Fedora Release Engineering - 5.15.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Mon Jun 12 2023 Jan Grulich - 5.15.10-1 +- 5.15.10 + +* Tue Apr 11 2023 Jan Grulich - 5.15.9 - Resolves: bz#2175746 -* Mon Mar 28 2022 Jan Grulich - 5.15.3-1 +* Wed Mar 29 2023 Than Ngo - 5.15.8-6 +- Related bz#2179854, rebuild against new qt5-qtbase + +* Mon Mar 27 2023 Than Ngo - 5.15.8-5 +- Fix bz#2179854, rebuild against new qt5-qtbase + +* Mon Mar 20 2023 Than Ngo - 5.15.8-4 +- Fix bz#2178389, rebuild against new qt5-qtbase + +* Tue Jan 31 2023 Jan Grulich - 5.15.8-3 +- migrated to SPDX license + +* Fri Jan 20 2023 Fedora Release Engineering - 5.15.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jan 05 2023 Jan Grulich - 5.15.8-1 +- 5.15.8 + +* Mon Oct 31 2022 Jan Grulich - 5.15.7-1 +- 5.15.7 + +* Tue Sep 20 2022 Jan Grulich - 5.15.6-1 +- 5.15.6 + +* Thu Aug 25 2022 Jan Grulich - 5.15.5-4 +- Re-enable CSD backports from Qt6 (will be used by QGnomePlatform) + +* Sat Jul 23 2022 Fedora Release Engineering - 5.15.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jul 20 2022 Jan Grulich - 5.15.5-2 +- Keep toplevel windows in the top left corner of the screen + +* Wed Jul 13 2022 Jan Grulich - 5.15.5-1 +- 5.15.5 + +* Mon May 16 2022 Jan Grulich - 5.15.4-1 +- 5.15.4 + +* Fri Apr 15 2022 Kenneth Topp - 5.15.3-2 +- Pull in latest kde/5.15 branch fixes + +* Fri Mar 04 2022 Jan Grulich - 5.15.3-1 - 5.15.3 - Resolves: bz#2061372 -* Tue Feb 15 2022 Jan Grulich - 5.15.2-15 -- Sync with Fedora - Resolves: bz#2051384 +* Fri Feb 11 2022 Jan Grulich - 5.15.2-21 +- Pull in latest kde/5.15 branch fixes + + backport a fix to crashes caused by patch 0043 -* Mon Jan 24 2022 Jan Grulich - 5.15.2-14 -- Sync with Fedora - Resolves: bz#2044169 +* Fri Feb 04 2022 Rex Dieter - 5.15.2-20 +- re-enable nvidia-related patches (44,100) -* Wed Dec 08 2021 Jan Grulich - 5.15.2-13 -- Sync with Fedora - Resolves: bz#2028778 +* Thu Feb 03 2022 Jan Grulich - 5.15.2-19 +- Disable some upstream patches causing a crash on Wayland sessions + bz#2049560 -* Thu Oct 14 2021 Jan Grulich - 5.15.2-12 -- Drop BR: tree - Resolves: bz#2014080 +* Mon Jan 31 2022 Jan Grulich - 5.15.2-18 +- Include potential upstream fix for Plasma panel freezes -* Wed Oct 13 2021 Jan Grulich - 5.15.2-11 -- Sync with Fedora - Resolves: bz#2012714 +* Thu Jan 20 2022 Jan Grulich - 5.15.2-17 +- Pull in latest kde/5.15 branch fixes -* Mon Sep 20 2021 Jan Grulich - 5.15.2-10 -- Sync with Fedora - Resolves: bz#2003935 +* Tue Jan 18 2022 Jan Grulich - 5.15.2-16 +- Pull in latest kde/5.15 branch fixes -* Mon Aug 23 2021 Jan Grulich - 5.15.2-9 -- Client: expose toplevel window state (change from Qt6) - Resolves: bz#1968292 +* Mon Dec 06 2021 Jan Grulich - 5.15.2-15 +- Pull in latest kde/5.15 branch fixes + +* Mon Oct 04 2021 Jan Grulich - 5.15.2-14 +- Update clipboard patch + +* Mon Oct 04 2021 Jan Grulich - 5.15.2-13 +- Backport clipboard fixes + Resolves: bz#1957503 -* Tue Aug 10 2021 Mohan Boddu - 5.15.2-8 -- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Related: rhbz#1991688 +* Tue Sep 14 2021 Rex Dieter - 5.15.2-12 +- Pull in latest kde/5.15 branch fixes -* Wed Jun 09 2021 Jan Grulich - 5.15.2-7 -- Add gating tests - Resolves: bz#1968477 +* Tue Sep 07 2021 Jan Grulich - 5.15.2-11 +- Include only some Qt6 API additions for better client-side decoration support + +* Tue Sep 07 2021 Jan Grulich - 5.15.2-10 +- Disable decoration shadow support + +* Mon Aug 30 2021 Jan Grulich - 5.15.2-9 +- Client: include decoration fixes and improvements from Qt6 + +* Fri Jul 23 2021 Fedora Release Engineering - 5.15.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jun 02 2021 Jan Grulich - 5.15.2-7 +- Client: expose toplevel window state (change from Qt6) -* Mon May 03 2021 Jan Grulich - 5.15.2-6 -- Sync with Fedora - Resolves: bz#1951152 +* Tue Apr 27 2021 Rex Dieter - 5.15.2-6 +- Pull in latest fixes from https://invent.kde.org/qt/qt/qtwayland -* Fri Apr 16 2021 Mohan Boddu - 5.15.2-5 -- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 +* Tue Apr 06 2021 Jan Grulich - 5.15.2-5 +- Backport changes from Qt 5.15.3 * Wed Jan 27 2021 Fedora Release Engineering - 5.15.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild