From 56326b1387dd1c7e2cb3472a344735ddf87bb570 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 8 Nov 2022 01:42:10 -0500 Subject: [PATCH] import qt5-qtwayland-5.15.3-1.el8 --- .gitignore | 2 +- .qt5-qtwayland.metadata | 2 +- ..._exit-instead-of-qFatal-for-wayland.patch} | 6 +- ...late-opaque-area-with-frame-margins.patch} | 6 +- ...eEvent-to-parent-on-subsurface-posi.patch} | 6 +- ...t-correct-decoration-margins-region.patch} | 6 +- ...cessing-dangling-pointers-in-destroy.patch | 38 -- ...-compositor-the-screen-we-re-expect.patch} | 6 +- ...ting-QT_SCALE_FACTOR-work-on-Wayland.patch | 38 -- ...landInputContext-to-accept-composed.patch} | 6 +- ...n-output-after-receiving-more-compl.patch} | 6 +- ...o-eglMakeCurrent-for-unintended-case.patch | 62 -- ...e-with-repeated-window-size-changes.patch} | 6 +- ...ting-QT_SCALE_FACTOR-work-on-Wayland.patch | 112 ---- ...bing-is-performed-in-correct-context.patch | 35 -- ...ude-locale.h-for-setlocale-LC_CTYPE.patch} | 6 +- ...ags-being-accepted-to-updating-the-.patch} | 6 +- ...-Fix-leaked-subsurface-wayland-items.patch | 36 -- ...ct-registry-listener-on-destruction.patch} | 6 +- ...ll-size-hints-before-the-first-comm.patch} | 6 +- ...Fix-memory-leak-in-QWaylandGLContext.patch | 38 -- ...window_geometry-only-once-configured.patch | 41 -- ...6-Fix-build.patch => 0013-Fix-build.patch} | 6 +- ...r.patch => 0014-Fix-remove-listener.patch} | 6 +- ... 0015-Hook-up-queryKeyboardModifers.patch} | 6 +- ...he-mask-if-we-do-not-have-a-surface.patch} | 6 +- ...if-image-format-is-supported-by-QIm.patch} | 6 +- SOURCES/0018-Fix-compilation.patch | 26 - ...x-crash-when-windows-are-shown-hidd.patch} | 6 +- ...n-t-always-recreate-frame-callbacks.patch} | 6 +- ...troy-frame-callback-in-the-actual-c.patch} | 6 +- ...-decoding-modifiers-map-in-Wayland-.patch} | 6 +- ...e-wl_keyboard-to-determine-active-s.patch} | 6 +- ...ty-clipboard-when-a-new-popup-windo.patch} | 6 +- ...edit-cursor-when-cursor-equals-to-0.patch} | 6 +- ... 0025-Client-Implement-DataDeviceV3.patch} | 6 +- ...tion-of-QDrag-object-until-after-we.patch} | 6 +- ...essing-of-events-when-showing-windo.patch} | 6 +- ...e-registry_global-out-of-constructor.patch | 85 +++ ...ct-flushRequest-after-forceRoundTrip.patch | 47 ++ ...-socket-polling-to-a-separate-event-.patch | 574 ++++++++++++++++++ ...ointer-for-null-before-use-in-ASSERT.patch | 30 + ...corations-when-the-shellSurface-is-n.patch | 39 ++ ...ace.damage_buffer-on-the-client-side.patch | 131 ++++ ...-input-method-module-could-be-loaded.patch | 29 + ...ent-Remove-mWaitingForUpdateDelivery.patch | 79 +++ ...ition-0-should-still-show-the-cursor.patch | 35 ++ ...port-context-destruction-was-omitted.patch | 29 - ...7-Update-the-preedit-styling-mapping.patch | 88 +++ ...-client-Simplify-round-trip-behavior.patch | 82 +++ ...0039-Client-Fix-opaque-region-setter.patch | 31 + ...proper-dependencies-in-compile-tests.patch | 126 ++++ ...traint-adjustments-for-popups-in-xdg.patch | 33 + ...-client-expose-toplevel-window-state.patch | 166 +++++ SPECS/qt5-qtwayland.spec | 99 +-- 55 files changed, 1711 insertions(+), 584 deletions(-) rename SOURCES/{0011-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch => 0001-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch} (91%) rename SOURCES/{0014-Translate-opaque-area-with-frame-margins.patch => 0002-Translate-opaque-area-with-frame-margins.patch} (90%) rename SOURCES/{0015-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch => 0003-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch} (96%) rename SOURCES/{0016-Get-correct-decoration-margins-region.patch => 0004-Get-correct-decoration-margins-region.patch} (92%) delete mode 100644 SOURCES/0005-Scanner-Avoid-accessing-dangling-pointers-in-destroy.patch rename SOURCES/{0017-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch => 0005-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch} (91%) delete mode 100644 SOURCES/0006-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch rename SOURCES/{0019-client-Allow-QWaylandInputContext-to-accept-composed.patch => 0006-client-Allow-QWaylandInputContext-to-accept-composed.patch} (98%) rename SOURCES/{0020-Client-Announce-an-output-after-receiving-more-compl.patch => 0007-Client-Announce-an-output-after-receiving-more-compl.patch} (97%) delete mode 100644 SOURCES/0007-Do-not-try-to-eglMakeCurrent-for-unintended-case.patch rename SOURCES/{0021-Fix-issue-with-repeated-window-size-changes.patch => 0008-Fix-issue-with-repeated-window-size-changes.patch} (95%) delete mode 100644 SOURCES/0008-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch delete mode 100644 SOURCES/0009-Ensure-that-grabbing-is-performed-in-correct-context.patch rename SOURCES/{0022-Include-locale.h-for-setlocale-LC_CTYPE.patch => 0009-Include-locale.h-for-setlocale-LC_CTYPE.patch} (85%) rename SOURCES/{0023-Client-Connect-drags-being-accepted-to-updating-the-.patch => 0010-Client-Connect-drags-being-accepted-to-updating-the-.patch} (92%) delete mode 100644 SOURCES/0010-Fix-leaked-subsurface-wayland-items.patch rename SOURCES/{0024-Client-Disconnect-registry-listener-on-destruction.patch => 0011-Client-Disconnect-registry-listener-on-destruction.patch} (93%) rename SOURCES/{0025-Client-Set-XdgShell-size-hints-before-the-first-comm.patch => 0012-Client-Set-XdgShell-size-hints-before-the-first-comm.patch} (94%) delete mode 100644 SOURCES/0012-Fix-memory-leak-in-QWaylandGLContext.patch delete mode 100644 SOURCES/0013-Client-Send-set_window_geometry-only-once-configured.patch rename SOURCES/{0026-Fix-build.patch => 0013-Fix-build.patch} (94%) rename SOURCES/{0027-Fix-remove-listener.patch => 0014-Fix-remove-listener.patch} (91%) rename SOURCES/{0028-Hook-up-queryKeyboardModifers.patch => 0015-Hook-up-queryKeyboardModifers.patch} (93%) rename SOURCES/{0029-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch => 0016-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch} (89%) rename SOURCES/{0030-Correctly-detect-if-image-format-is-supported-by-QIm.patch => 0017-Correctly-detect-if-image-format-is-supported-by-QIm.patch} (95%) delete mode 100644 SOURCES/0018-Fix-compilation.patch rename SOURCES/{0031-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch => 0018-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch} (88%) rename SOURCES/{0032-Client-Don-t-always-recreate-frame-callbacks.patch => 0019-Client-Don-t-always-recreate-frame-callbacks.patch} (96%) rename SOURCES/{0033-Client-Always-destroy-frame-callback-in-the-actual-c.patch => 0020-Client-Always-destroy-frame-callback-in-the-actual-c.patch} (93%) rename SOURCES/{0034-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch => 0021-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch} (90%) rename SOURCES/{0035-Wayland-client-use-wl_keyboard-to-determine-active-s.patch => 0022-Wayland-client-use-wl_keyboard-to-determine-active-s.patch} (99%) rename SOURCES/{0036-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch => 0023-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch} (94%) rename SOURCES/{0038-Set-preedit-cursor-when-cursor-equals-to-0.patch => 0024-Set-preedit-cursor-when-cursor-equals-to-0.patch} (89%) rename SOURCES/{0039-Client-Implement-DataDeviceV3.patch => 0025-Client-Implement-DataDeviceV3.patch} (99%) rename SOURCES/{0040-Client-Delay-deletion-of-QDrag-object-until-after-we.patch => 0026-Client-Delay-deletion-of-QDrag-object-until-after-we.patch} (93%) rename SOURCES/{0041-Client-Avoid-processing-of-events-when-showing-windo.patch => 0027-Client-Avoid-processing-of-events-when-showing-windo.patch} (91%) create mode 100644 SOURCES/0028-Handle-registry_global-out-of-constructor.patch create mode 100644 SOURCES/0029-Connect-flushRequest-after-forceRoundTrip.patch create mode 100644 SOURCES/0030-Move-the-wayland-socket-polling-to-a-separate-event-.patch create mode 100644 SOURCES/0031-Check-pointer-for-null-before-use-in-ASSERT.patch create mode 100644 SOURCES/0032-Do-not-create-decorations-when-the-shellSurface-is-n.patch create mode 100644 SOURCES/0033-Use-wl_surface.damage_buffer-on-the-client-side.patch create mode 100644 SOURCES/0034-Fix-crash-if-no-input-method-module-could-be-loaded.patch create mode 100644 SOURCES/0035-Client-Remove-mWaitingForUpdateDelivery.patch create mode 100644 SOURCES/0036-Cursor-position-0-should-still-show-the-cursor.patch delete mode 100644 SOURCES/0037-Fix-backport-context-destruction-was-omitted.patch create mode 100644 SOURCES/0037-Update-the-preedit-styling-mapping.patch create mode 100644 SOURCES/0038-client-Simplify-round-trip-behavior.patch create mode 100644 SOURCES/0039-Client-Fix-opaque-region-setter.patch create mode 100644 SOURCES/0040-Use-proper-dependencies-in-compile-tests.patch create mode 100644 SOURCES/0041-Client-set-constraint-adjustments-for-popups-in-xdg.patch create mode 100644 SOURCES/qtwayland-client-expose-toplevel-window-state.patch diff --git a/.gitignore b/.gitignore index 53f6155..c03e7cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/qtwayland-everywhere-src-5.15.2.tar.xz +SOURCES/qtwayland-everywhere-opensource-src-5.15.3.tar.xz diff --git a/.qt5-qtwayland.metadata b/.qt5-qtwayland.metadata index 1c7bc39..4f6919f 100644 --- a/.qt5-qtwayland.metadata +++ b/.qt5-qtwayland.metadata @@ -1 +1 @@ -b547a38762ca6ef6d14545b4d51aabbcf06cc17e SOURCES/qtwayland-everywhere-src-5.15.2.tar.xz +021b5c6fa4f5dc4c3cc87da9a380da100a30ffdf SOURCES/qtwayland-everywhere-opensource-src-5.15.3.tar.xz diff --git a/SOURCES/0011-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch b/SOURCES/0001-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch similarity index 91% rename from SOURCES/0011-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch rename to SOURCES/0001-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch index 5860630..c7c1e30 100644 --- a/SOURCES/0011-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch +++ b/SOURCES/0001-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch @@ -1,7 +1,7 @@ -From 9ee2ea141adc7765f6c212e63839ef23a4494b30 Mon Sep 17 00:00:00 2001 +From 610af8f0ba9de42cb22228e4e4b3fd77275e3e17 Mon Sep 17 00:00:00 2001 From: Weng Xuetian Date: Tue, 9 Mar 2021 10:43:59 -0800 -Subject: [PATCH 11/36] Use qWarning and _exit() instead of qFatal for wayland +Subject: [PATCH 01/40] Use qWarning and _exit() instead of qFatal for wayland error This type of error is likely to happen upon system logout. qFatal would @@ -34,5 +34,5 @@ index fe094f6f..f10c1f79 100644 void QWaylandDisplay::flushRequests() -- -2.33.1 +2.35.1 diff --git a/SOURCES/0014-Translate-opaque-area-with-frame-margins.patch b/SOURCES/0002-Translate-opaque-area-with-frame-margins.patch similarity index 90% rename from SOURCES/0014-Translate-opaque-area-with-frame-margins.patch rename to SOURCES/0002-Translate-opaque-area-with-frame-margins.patch index 6cc32a4..3019b00 100644 --- a/SOURCES/0014-Translate-opaque-area-with-frame-margins.patch +++ b/SOURCES/0002-Translate-opaque-area-with-frame-margins.patch @@ -1,7 +1,7 @@ -From a3e3ac1c86a956b25b1dc24f14518b6e6c96bcfc Mon Sep 17 00:00:00 2001 +From d353938c1a07a803656489cada8683e31f8f1c62 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Wed, 10 Feb 2021 17:11:27 +0100 -Subject: [PATCH 14/36] Translate opaque area with frame margins +Subject: [PATCH 02/40] Translate opaque area with frame margins The opaque area doesn't take window decorations into account, which may result into possible graphical artefacts. @@ -36,5 +36,5 @@ index e875af3a..2af39977 100644 wl_region_destroy(region); } -- -2.33.1 +2.35.1 diff --git a/SOURCES/0015-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch b/SOURCES/0003-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch similarity index 96% rename from SOURCES/0015-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch rename to SOURCES/0003-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch index d342e82..ad11445 100644 --- a/SOURCES/0015-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch +++ b/SOURCES/0003-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch @@ -1,7 +1,7 @@ -From 2073ff99e62d4f99ed3f1f45559c5b68a61c5f66 Mon Sep 17 00:00:00 2001 +From 11e9bd41951ec9f229e20566f821aa39ca011352 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 14 Sep 2020 17:08:39 +0100 -Subject: [PATCH 15/36] Client: Send exposeEvent to parent on subsurface +Subject: [PATCH 03/40] Client: Send exposeEvent to parent on subsurface position changes When a subsurface is moved, we need the parent window to commit to apply @@ -93,5 +93,5 @@ index b8a65f15..95e4e609 100644 // Used to cause a crash in libwayland (QTBUG-79674) -- -2.33.1 +2.35.1 diff --git a/SOURCES/0016-Get-correct-decoration-margins-region.patch b/SOURCES/0004-Get-correct-decoration-margins-region.patch similarity index 92% rename from SOURCES/0016-Get-correct-decoration-margins-region.patch rename to SOURCES/0004-Get-correct-decoration-margins-region.patch index 8d827bf..ee523a4 100644 --- a/SOURCES/0016-Get-correct-decoration-margins-region.patch +++ b/SOURCES/0004-Get-correct-decoration-margins-region.patch @@ -1,7 +1,7 @@ -From 6810b0f66a34056bfe0da7299d7a768e700e58f5 Mon Sep 17 00:00:00 2001 +From 50a9256db8cd43665cf74cf94a293d1c05375d33 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Thu, 11 Feb 2021 15:12:32 +0100 -Subject: [PATCH 16/36] Get correct decoration margins region +Subject: [PATCH 04/40] Get correct decoration margins region Size we use to calculate margins region already contains size including margins. This resulted into bigger region and not properly damaging @@ -35,5 +35,5 @@ index 87dd6cea..b6ee43c9 100644 } -- -2.33.1 +2.35.1 diff --git a/SOURCES/0005-Scanner-Avoid-accessing-dangling-pointers-in-destroy.patch b/SOURCES/0005-Scanner-Avoid-accessing-dangling-pointers-in-destroy.patch deleted file mode 100644 index cde64df..0000000 --- a/SOURCES/0005-Scanner-Avoid-accessing-dangling-pointers-in-destroy.patch +++ /dev/null @@ -1,38 +0,0 @@ -From e5c272423d1bba2825086b82fd97499237a6fa4b Mon Sep 17 00:00:00 2001 -From: Vlad Zahorodnii -Date: Fri, 30 Oct 2020 16:55:30 +0200 -Subject: [PATCH 05/36] Scanner: Avoid accessing dangling pointers in - destroy_func() - -Usually, the object associated with the resource gets destroyed in the -destroy_resource() function. - -Therefore, we need to double-check that the object is still alive before -trying to reset its m_resource. - -Change-Id: I26408228f58919db17eb29584a1cbd4a9427d25c -Reviewed-by: Eskil Abrahamsen Blomfeldt -(cherry picked from commit 735164b5c2a2637a8d53a8803a2401e4ef477ff0) -Reviewed-by: Qt Cherry-pick Bot ---- - src/qtwaylandscanner/qtwaylandscanner.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp -index 1d635f06..e2f87bbd 100644 ---- a/src/qtwaylandscanner/qtwaylandscanner.cpp -+++ b/src/qtwaylandscanner/qtwaylandscanner.cpp -@@ -814,7 +814,9 @@ bool Scanner::process() - printf(" if (Q_LIKELY(that)) {\n"); - printf(" that->m_resource_map.remove(resource->client(), resource);\n"); - printf(" that->%s_destroy_resource(resource);\n", interfaceNameStripped); -- printf(" if (that->m_resource == resource)\n"); -+ printf("\n"); -+ printf(" that = resource->%s_object;\n", interfaceNameStripped); -+ printf(" if (that && that->m_resource == resource)\n"); - printf(" that->m_resource = nullptr;\n"); - printf(" }\n"); - printf(" delete resource;\n"); --- -2.33.1 - diff --git a/SOURCES/0017-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch b/SOURCES/0005-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch similarity index 91% rename from SOURCES/0017-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch rename to SOURCES/0005-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch index ab9600c..7d27a60 100644 --- a/SOURCES/0017-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch +++ b/SOURCES/0005-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch @@ -1,7 +1,7 @@ -From cea69b8adec1e61adc1fa04cbf46b77c0d72c75e Mon Sep 17 00:00:00 2001 +From f408482e4364293e5ab9889854a759796436971d Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 23 Nov 2020 20:07:02 +0100 -Subject: [PATCH 17/36] xdgshell: Tell the compositor the screen we're +Subject: [PATCH 05/40] xdgshell: Tell the compositor the screen we're expecting to fill The xdgshell protocol allows us to tell the output to fill. This makes @@ -37,5 +37,5 @@ index 1c762944..3a1569f7 100644 } -- -2.33.1 +2.35.1 diff --git a/SOURCES/0006-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch b/SOURCES/0006-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch deleted file mode 100644 index acfbf99..0000000 --- a/SOURCES/0006-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch +++ /dev/null @@ -1,38 +0,0 @@ -From a825fb5f714fd79d16cc3ebbdd327e7961b07d0a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= -Date: Mon, 16 Nov 2020 19:37:33 +0100 -Subject: [PATCH 06/36] Make setting QT_SCALE_FACTOR work on Wayland - -Follow-up to 8cb1b07aea12d50b4fecc45c903705dfd368022a, -fixes one additional case (Use of minimum/maximum size). - -Fixes: QTBUG-87762 -Change-Id: I73e0df2529b0cadf25ad50ea7459cdbb92caf424 -Reviewed-by: Eskil Abrahamsen Blomfeldt -(cherry picked from commit 6ed363e3665f17d935f8636d9c958154c898f5c5) -Reviewed-by: Qt Cherry-pick Bot ---- - src/client/qwaylandwindow.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index bc031ed5..eb053406 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -332,9 +332,11 @@ void QWaylandWindow::setWindowIcon(const QIcon &icon) - - void QWaylandWindow::setGeometry_helper(const QRect &rect) - { -+ QSize minimum = windowMinimumSize(); -+ QSize maximum = windowMaximumSize(); - QPlatformWindow::setGeometry(QRect(rect.x(), rect.y(), -- qBound(window()->minimumWidth(), rect.width(), window()->maximumWidth()), -- qBound(window()->minimumHeight(), rect.height(), window()->maximumHeight()))); -+ qBound(minimum.width(), rect.width(), maximum.width()), -+ qBound(minimum.height(), rect.height(), maximum.height()))); - - if (mSubSurfaceWindow) { - QMargins m = QPlatformWindow::parent()->frameMargins(); --- -2.33.1 - diff --git a/SOURCES/0019-client-Allow-QWaylandInputContext-to-accept-composed.patch b/SOURCES/0006-client-Allow-QWaylandInputContext-to-accept-composed.patch similarity index 98% rename from SOURCES/0019-client-Allow-QWaylandInputContext-to-accept-composed.patch rename to SOURCES/0006-client-Allow-QWaylandInputContext-to-accept-composed.patch index ff39a0b..ebec918 100644 --- a/SOURCES/0019-client-Allow-QWaylandInputContext-to-accept-composed.patch +++ b/SOURCES/0006-client-Allow-QWaylandInputContext-to-accept-composed.patch @@ -1,7 +1,7 @@ -From 91c48320633e493b4cd519e5d73b836a878b2b77 Mon Sep 17 00:00:00 2001 +From d6dd815014564f235fb972eb72d28ccca6cf3549 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 10 Mar 2021 01:09:13 +0100 -Subject: [PATCH 19/36] client: Allow QWaylandInputContext to accept composed +Subject: [PATCH 06/40] client: Allow QWaylandInputContext to accept composed key combinations At the moment, we are forcing user to choose to either compose or use @@ -253,5 +253,5 @@ index 7ad8e05e..c53ccb78 100644 } -- -2.33.1 +2.35.1 diff --git a/SOURCES/0020-Client-Announce-an-output-after-receiving-more-compl.patch b/SOURCES/0007-Client-Announce-an-output-after-receiving-more-compl.patch similarity index 97% rename from SOURCES/0020-Client-Announce-an-output-after-receiving-more-compl.patch rename to SOURCES/0007-Client-Announce-an-output-after-receiving-more-compl.patch index 3249a69..f9b7750 100644 --- a/SOURCES/0020-Client-Announce-an-output-after-receiving-more-compl.patch +++ b/SOURCES/0007-Client-Announce-an-output-after-receiving-more-compl.patch @@ -1,7 +1,7 @@ -From d5186701e27ad6f09f3944809cec2a25c5328026 Mon Sep 17 00:00:00 2001 +From a6fb2a976ecd778e450afe89c180c8c748beb568 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 5 May 2021 20:49:26 +0300 -Subject: [PATCH 20/36] Client: Announce an output after receiving more +Subject: [PATCH 07/40] 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.33.1 +2.35.1 diff --git a/SOURCES/0007-Do-not-try-to-eglMakeCurrent-for-unintended-case.patch b/SOURCES/0007-Do-not-try-to-eglMakeCurrent-for-unintended-case.patch deleted file mode 100644 index dd1eb8c..0000000 --- a/SOURCES/0007-Do-not-try-to-eglMakeCurrent-for-unintended-case.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 2c0a03e9aea13831d05ac03996949f888afd5085 Mon Sep 17 00:00:00 2001 -From: Jaehak Lee -Date: Sun, 8 Nov 2020 11:40:06 +0900 -Subject: [PATCH 07/36] Do not try to eglMakeCurrent for unintended case - -The QSGThreadedRenderLoop::hide can be called at twice, -when the QWindowPrivate::setVisible(false) is called. - -The eglSurface is EGL_NO_SURFACE when the second QSGThreadedRenderLoop::hide is -called. And if EGL_KHR_surfaceless_context is supported, the eglMakeCurrent -don't return the false. - -But this case is not intended. So, add the defence code for above case. - -Fixes: QTBUG-88277 -Change-Id: Ia9e5990303e98f0eedc48531e5af62ff9961f419 -Reviewed-by: Laszlo Agocs -Reviewed-by: Eskil Abrahamsen Blomfeldt ---- - .../client/wayland-egl/qwaylandglcontext.cpp | 6 ++++++ - .../client/wayland-egl/qwaylandglcontext.h | 1 + - 2 files changed, 7 insertions(+) - -diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -index ccebf43d..681f82f4 100644 ---- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -@@ -336,6 +336,8 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis - << "It may also cause the event loop to freeze in some situations"; - } - -+ m_supportSurfaceLessContext = q_hasEglExtension(m_eglDisplay, "EGL_KHR_surfaceless_context"); -+ - updateGLFormat(); - } - -@@ -439,6 +441,10 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) - eglSurface = window->eglSurface(); - } - -+ if (eglSurface == EGL_NO_SURFACE && m_supportSurfaceLessContext) { -+ return false; -+ } -+ - if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) { - qWarning("QWaylandGLContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this); - window->setCanResize(true); -diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h -index 46c7bb76..93edaec0 100644 ---- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h -+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h -@@ -93,6 +93,7 @@ private: - DecorationsBlitter *m_blitter = nullptr; - uint m_api; - bool m_supportNonBlockingSwap = true; -+ bool m_supportSurfaceLessContext = false; - }; - - } --- -2.33.1 - diff --git a/SOURCES/0021-Fix-issue-with-repeated-window-size-changes.patch b/SOURCES/0008-Fix-issue-with-repeated-window-size-changes.patch similarity index 95% rename from SOURCES/0021-Fix-issue-with-repeated-window-size-changes.patch rename to SOURCES/0008-Fix-issue-with-repeated-window-size-changes.patch index 9c7ebde..1733e6c 100644 --- a/SOURCES/0021-Fix-issue-with-repeated-window-size-changes.patch +++ b/SOURCES/0008-Fix-issue-with-repeated-window-size-changes.patch @@ -1,7 +1,7 @@ -From 62494312db0f58053d1342bfacc7984186fdf3a6 Mon Sep 17 00:00:00 2001 +From bb9288c913dc49aefc3fad03ec243809b6b21a88 Mon Sep 17 00:00:00 2001 From: Jaeyoon Jung Date: Mon, 15 Feb 2021 08:31:06 +0900 -Subject: [PATCH 21/36] Fix issue with repeated window size changes +Subject: [PATCH 08/40] 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 @@ -54,5 +54,5 @@ index 5b1f4d56..0079dfef 100644 } -- -2.33.1 +2.35.1 diff --git a/SOURCES/0008-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch b/SOURCES/0008-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch deleted file mode 100644 index 4e10015..0000000 --- a/SOURCES/0008-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 10005185e06857ce119c50fe710f9eedde06ec5e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= -Date: Fri, 13 Nov 2020 11:21:50 +0100 -Subject: [PATCH 08/36] Make setting QT_SCALE_FACTOR work on Wayland - -QWindow geometry accessors return geometry in device -independent pixels. Normally this coordinate system -is equivalent to the Wayland native coordinate system, -but this is not the case when QT_SCALE_FACTOR is set. - -Replace QWindow geometry calls with the helpers from -QPlatformWindow which return geometry in the native -coordinate system: - -QWindow::geometry() -> QPlatformWindow::windowGeometry() -QWindow::frameGeometry() -> QPlatformWindow::windowFrameGeometry() - -Task-number: QTBUG-87762 -Fixes: QTBUG-88064 -(cherry-picked from commit 8cb1b07aea12d50b4fecc45c903705dfd368022a) -Change-Id: I6e2029bc6210f12441ae7c9d8b678271e9922dde -Reviewed-by: Eskil Abrahamsen Blomfeldt ---- - src/client/qwaylandwindow.cpp | 7 ++++--- - .../shellintegration/wl-shell/qwaylandwlshellsurface.cpp | 2 +- - .../shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp | 2 +- - .../shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp | 2 +- - .../shellintegration/xdg-shell/qwaylandxdgshell.cpp | 2 +- - 5 files changed, 8 insertions(+), 7 deletions(-) - -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index eb053406..9b343702 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -194,10 +194,11 @@ void QWaylandWindow::initWindow() - if (QScreen *s = window()->screen()) - setOrientationMask(s->orientationUpdateMask()); - setWindowFlags(window()->flags()); -- if (window()->geometry().isEmpty()) -+ QRect geometry = windowGeometry(); -+ if (geometry.isEmpty()) - setGeometry_helper(QRect(QPoint(), QSize(500,500))); - else -- setGeometry_helper(window()->geometry()); -+ setGeometry_helper(geometry); - setMask(window()->mask()); - if (mShellSurface) - mShellSurface->requestWindowStates(window()->windowStates()); -@@ -431,7 +432,7 @@ void QWaylandWindow::setVisible(bool visible) - initWindow(); - mDisplay->flushRequests(); - -- setGeometry(window()->geometry()); -+ setGeometry(windowGeometry()); - // Don't flush the events here, or else the newly visible window may start drawing, but since - // there was no frame before it will be stuck at the waitForFrameSync() in - // QWaylandShmBackingStore::beginPaint(). -diff --git a/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp b/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp -index 245fec19..8f41118d 100644 ---- a/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp -+++ b/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp -@@ -134,7 +134,7 @@ void QWaylandWlShellSurface::applyConfigure() - { - if ((m_pending.states & (Qt::WindowMaximized|Qt::WindowFullScreen)) - && !(m_applied.states & (Qt::WindowMaximized|Qt::WindowFullScreen))) { -- m_normalSize = m_window->window()->frameGeometry().size(); -+ m_normalSize = m_window->windowFrameGeometry().size(); - } - - if (m_pending.states != m_applied.states) -diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp -index 770fad7e..73aba1ee 100644 ---- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp -+++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp -@@ -157,7 +157,7 @@ void QWaylandXdgSurfaceV5::applyConfigure() - if (m_pending.isResizing) - m_normalSize = m_pending.size; - else if (!(m_acked.states & (Qt::WindowMaximized|Qt::WindowFullScreen))) -- m_normalSize = m_window->window()->frameGeometry().size(); -+ m_normalSize = m_window->windowFrameGeometry().size(); - - if ((m_pending.states & Qt::WindowActive) && !(m_acked.states & Qt::WindowActive)) - m_window->display()->handleWindowActivated(m_window); -diff --git a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp -index c137b308..8c371661 100644 ---- a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp -+++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp -@@ -72,7 +72,7 @@ QWaylandXdgSurfaceV6::Toplevel::~Toplevel() - void QWaylandXdgSurfaceV6::Toplevel::applyConfigure() - { - if (!(m_applied.states & (Qt::WindowMaximized|Qt::WindowFullScreen))) -- m_normalSize = m_xdgSurface->m_window->window()->frameGeometry().size(); -+ m_normalSize = m_xdgSurface->m_window->windowFrameGeometry().size(); - - if ((m_pending.states & Qt::WindowActive) && !(m_applied.states & Qt::WindowActive)) - m_xdgSurface->m_window->display()->handleWindowActivated(m_xdgSurface->m_window); -diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index b6d23ac1..1c762944 100644 ---- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -@@ -83,7 +83,7 @@ QWaylandXdgSurface::Toplevel::~Toplevel() - void QWaylandXdgSurface::Toplevel::applyConfigure() - { - if (!(m_applied.states & (Qt::WindowMaximized|Qt::WindowFullScreen))) -- m_normalSize = m_xdgSurface->m_window->window()->frameGeometry().size(); -+ m_normalSize = m_xdgSurface->m_window->windowFrameGeometry().size(); - - if ((m_pending.states & Qt::WindowActive) && !(m_applied.states & Qt::WindowActive)) - m_xdgSurface->m_window->display()->handleWindowActivated(m_xdgSurface->m_window); --- -2.33.1 - diff --git a/SOURCES/0009-Ensure-that-grabbing-is-performed-in-correct-context.patch b/SOURCES/0009-Ensure-that-grabbing-is-performed-in-correct-context.patch deleted file mode 100644 index 1a98f8e..0000000 --- a/SOURCES/0009-Ensure-that-grabbing-is-performed-in-correct-context.patch +++ /dev/null @@ -1,35 +0,0 @@ -From dba4bc4f1d6dfee9fe9433c55b15653d703bed4f Mon Sep 17 00:00:00 2001 -From: Andreas Cord-Landwehr -Date: Wed, 2 Dec 2020 20:55:52 +0100 -Subject: [PATCH 09/36] Ensure that grabbing is performed in correct context - -For multi-display rendering on EGL, it is mandatory that the grabbing of -the surface happens in the same EGL context as the surface belongs to. -By adding the grabbing to the rendering stage of the image, this -relation is forced. - -Task-number: QTBUG-87597 -Change-Id: I50f40df1215aa771d714065e942c5a738ba6269f -Reviewed-by: Eskil Abrahamsen Blomfeldt -(cherry picked from commit ab3a1a07f3d1e0d5a9e9d97b6b3b587180e2f4c8) -Reviewed-by: Qt Cherry-pick Bot ---- - src/compositor/compositor_api/qwaylandquickcompositor.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/compositor/compositor_api/qwaylandquickcompositor.cpp b/src/compositor/compositor_api/qwaylandquickcompositor.cpp -index 49f0860e..db1cf00f 100644 ---- a/src/compositor/compositor_api/qwaylandquickcompositor.cpp -+++ b/src/compositor/compositor_api/qwaylandquickcompositor.cpp -@@ -161,7 +161,7 @@ void QWaylandQuickCompositor::grabSurface(QWaylandSurfaceGrabber *grabber, const - GrabState *state = new GrabState; - state->grabber = grabber; - state->buffer = buffer; -- static_cast(output->window())->scheduleRenderJob(state, QQuickWindow::NoStage); -+ static_cast(output->window())->scheduleRenderJob(state, QQuickWindow::AfterRenderingStage); - #else - emit grabber->failed(QWaylandSurfaceGrabber::UnknownBufferType); - #endif --- -2.33.1 - diff --git a/SOURCES/0022-Include-locale.h-for-setlocale-LC_CTYPE.patch b/SOURCES/0009-Include-locale.h-for-setlocale-LC_CTYPE.patch similarity index 85% rename from SOURCES/0022-Include-locale.h-for-setlocale-LC_CTYPE.patch rename to SOURCES/0009-Include-locale.h-for-setlocale-LC_CTYPE.patch index fcb0973..ca46b4f 100644 --- a/SOURCES/0022-Include-locale.h-for-setlocale-LC_CTYPE.patch +++ b/SOURCES/0009-Include-locale.h-for-setlocale-LC_CTYPE.patch @@ -1,7 +1,7 @@ -From 1ccebbab3a42690a0812e2c4c76016799bf6cf1f Mon Sep 17 00:00:00 2001 +From 82720c9d7e0a706793f9716144347171820ddf4d Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 10 May 2021 14:38:49 +0200 -Subject: [PATCH 22/36] Include locale.h for setlocale/LC_CTYPE +Subject: [PATCH 09/40] Include locale.h for setlocale/LC_CTYPE Pick-to: 5.15 Change-Id: Iced32a31a63cec71008549c1e0961d59ffc45a37 @@ -27,5 +27,5 @@ index ef5aa375..503fd735 100644 Q_LOGGING_CATEGORY(qLcQpaInputMethods, "qt.qpa.input.methods") -- -2.33.1 +2.35.1 diff --git a/SOURCES/0023-Client-Connect-drags-being-accepted-to-updating-the-.patch b/SOURCES/0010-Client-Connect-drags-being-accepted-to-updating-the-.patch similarity index 92% rename from SOURCES/0023-Client-Connect-drags-being-accepted-to-updating-the-.patch rename to SOURCES/0010-Client-Connect-drags-being-accepted-to-updating-the-.patch index 5780e26..43e73a6 100644 --- a/SOURCES/0023-Client-Connect-drags-being-accepted-to-updating-the-.patch +++ b/SOURCES/0010-Client-Connect-drags-being-accepted-to-updating-the-.patch @@ -1,7 +1,7 @@ -From fcc2f57cefa66339c8cb6632f45a47fbb99bb60d Mon Sep 17 00:00:00 2001 +From 6b2084a4c9f87d3575fc6aec3f7454304bcc6188 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 9 Feb 2021 16:09:21 +0000 -Subject: [PATCH 23/36] Client: Connect drags being accepted to updating the +Subject: [PATCH 10/40] Client: Connect drags being accepted to updating the source drag icon Currently in a multi-process drag and drop when the other client accepts @@ -35,5 +35,5 @@ index 19944a34..54a69c3c 100644 start_drag(m_dragSource->object(), origin->wlSurface(), icon->wlSurface(), m_display->currentInputDevice()->serial()); return true; -- -2.33.1 +2.35.1 diff --git a/SOURCES/0010-Fix-leaked-subsurface-wayland-items.patch b/SOURCES/0010-Fix-leaked-subsurface-wayland-items.patch deleted file mode 100644 index fbfaf41..0000000 --- a/SOURCES/0010-Fix-leaked-subsurface-wayland-items.patch +++ /dev/null @@ -1,36 +0,0 @@ -From a8d35b3c18bdb05a0da3ed50a554a7b7bd4ebed3 Mon Sep 17 00:00:00 2001 -From: Eskil Abrahamsen Blomfeldt -Date: Mon, 30 Nov 2020 13:13:18 +0100 -Subject: [PATCH 10/36] Fix leaked subsurface wayland items - -Whenever a subsurface was added we would create a QWaylandQuickItem, -but this was never deleted. It is one-to-one with the surface, so it -should be deleted at the same time. - -[ChangeLog][QtWaylandCompositor] Fixed a memory leak when creating -subsurfaces. - -Task-number: QTBUG-88782 -Change-Id: If4b3f15200ce3bd123ff73847d3593d174a39229 -Reviewed-by: Paul Olav Tvete -(cherry picked from commit 38fc568b30bf916165324c2cd2db127d2a9aa68c) -Reviewed-by: Qt Cherry-pick Bot ---- - src/compositor/compositor_api/qwaylandquickitem.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp -index 15f0195c..2218f43a 100644 ---- a/src/compositor/compositor_api/qwaylandquickitem.cpp -+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp -@@ -737,6 +737,7 @@ void QWaylandQuickItem::handleSubsurfaceAdded(QWaylandSurface *childSurface) - childItem->setVisible(true); - childItem->setParentItem(this); - connect(childSurface, &QWaylandSurface::subsurfacePositionChanged, childItem, &QWaylandQuickItem::handleSubsurfacePosition); -+ connect(childSurface, &QWaylandSurface::destroyed, childItem, &QObject::deleteLater); - } else { - bool success = QMetaObject::invokeMethod(d->subsurfaceHandler, "handleSubsurfaceAdded", Q_ARG(QWaylandSurface *, childSurface)); - if (!success) --- -2.33.1 - diff --git a/SOURCES/0024-Client-Disconnect-registry-listener-on-destruction.patch b/SOURCES/0011-Client-Disconnect-registry-listener-on-destruction.patch similarity index 93% rename from SOURCES/0024-Client-Disconnect-registry-listener-on-destruction.patch rename to SOURCES/0011-Client-Disconnect-registry-listener-on-destruction.patch index a2afc6b..5d31df9 100644 --- a/SOURCES/0024-Client-Disconnect-registry-listener-on-destruction.patch +++ b/SOURCES/0011-Client-Disconnect-registry-listener-on-destruction.patch @@ -1,7 +1,7 @@ -From 1b5e43a593e917610e6245f7a272ac081c508ba4 Mon Sep 17 00:00:00 2001 +From a1d6aa2078b8a840469f13ae720669cb4f99291d Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 14 May 2021 13:23:24 +0100 -Subject: [PATCH 24/36] Client: Disconnect registry listener on destruction +Subject: [PATCH 11/40] 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 @@ -45,5 +45,5 @@ index 98272e57..5bd28398 100644 QtWaylandClient::QWaylandIntegration *integration() const; int version() const; -- -2.33.1 +2.35.1 diff --git a/SOURCES/0025-Client-Set-XdgShell-size-hints-before-the-first-comm.patch b/SOURCES/0012-Client-Set-XdgShell-size-hints-before-the-first-comm.patch similarity index 94% rename from SOURCES/0025-Client-Set-XdgShell-size-hints-before-the-first-comm.patch rename to SOURCES/0012-Client-Set-XdgShell-size-hints-before-the-first-comm.patch index 84ef091..347c74b 100644 --- a/SOURCES/0025-Client-Set-XdgShell-size-hints-before-the-first-comm.patch +++ b/SOURCES/0012-Client-Set-XdgShell-size-hints-before-the-first-comm.patch @@ -1,7 +1,7 @@ -From 36a552fa530be57091e986ebd1468d75d3061743 Mon Sep 17 00:00:00 2001 +From d9d7c73f908db351921cf016c5e079f3d13e84aa Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 3 May 2021 23:01:53 +0100 -Subject: [PATCH 25/36] Client: Set XdgShell size hints before the first commit +Subject: [PATCH 12/40] 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 @@ -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.33.1 +2.35.1 diff --git a/SOURCES/0012-Fix-memory-leak-in-QWaylandGLContext.patch b/SOURCES/0012-Fix-memory-leak-in-QWaylandGLContext.patch deleted file mode 100644 index 114570b..0000000 --- a/SOURCES/0012-Fix-memory-leak-in-QWaylandGLContext.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 9df11e79b46c77d8c83f765b2a8e85b639fd55a2 Mon Sep 17 00:00:00 2001 -From: Eskil Abrahamsen Blomfeldt -Date: Tue, 5 Jan 2021 09:08:50 +0100 -Subject: [PATCH 12/36] Fix memory leak in QWaylandGLContext - -We were leaking an EGL context with every GL context created, -which lead to rapid OOM errors in stress tests. - -[ChangeLog][Qt Wayland Client] Fixed a memory leak when creating -QOpenGLContexts on Wayland and using the wayland-egl backend. - -Fixes: QTBUG-85608 -Pick-to: 5.15 -Pick-to: 6.0 -Change-Id: I8426b5df36ec7ab9e66ce15f9e02edad3aca60b9 -Reviewed-by: David Edmundson ---- - .../client/wayland-egl/qwaylandglcontext.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -index 681f82f4..befadedc 100644 ---- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -@@ -406,7 +406,9 @@ void QWaylandGLContext::updateGLFormat() - QWaylandGLContext::~QWaylandGLContext() - { - delete m_blitter; -- eglDestroyContext(m_eglDisplay, m_context); -+ m_blitter = nullptr; -+ if (m_decorationsContext != EGL_NO_CONTEXT) -+ eglDestroyContext(eglDisplay(), m_decorationsContext); - } - - bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) --- -2.33.1 - diff --git a/SOURCES/0013-Client-Send-set_window_geometry-only-once-configured.patch b/SOURCES/0013-Client-Send-set_window_geometry-only-once-configured.patch deleted file mode 100644 index 5b88f17..0000000 --- a/SOURCES/0013-Client-Send-set_window_geometry-only-once-configured.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 7db4f83c39d2a0c709bc0b9c0de3946d3b4ebfd5 Mon Sep 17 00:00:00 2001 -From: David Edmundson -Date: Mon, 16 Nov 2020 14:57:36 +0000 -Subject: [PATCH 13/36] Client: Send set_window_geometry only once configured - -The geometry only makes sense when a buffer exists, our currently send -value is somewhat meaningless, but till now harmless. - -A specification clarification implies that it is an error if the -calculated effective window geometry is null, rather than just checking -the sent value. This is the case if set_window_geometry is sent before a -buffer is attached. - -On our first configure call we enter resizeFromApplyConfigure which will -hit this path and send the initial state. - -Pick-to: 5.15 -Pick-to: 6.1 -Pick-to: 6.0 -Change-Id: Ib57ebe8b64210eae86e79dfdd6b5cb8a986b020b -Reviewed-by: Eskil Abrahamsen Blomfeldt ---- - src/client/qwaylandwindow.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 9b343702..e875af3a 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -365,7 +365,7 @@ void QWaylandWindow::setGeometry(const QRect &rect) - if (isExposed() && !mInResizeFromApplyConfigure && exposeGeometry != mLastExposeGeometry) - sendExposeEvent(exposeGeometry); - -- if (mShellSurface) -+ if (mShellSurface && isExposed()) - mShellSurface->setWindowGeometry(windowContentGeometry()); - - if (isOpaque() && mMask.isEmpty()) --- -2.33.1 - diff --git a/SOURCES/0026-Fix-build.patch b/SOURCES/0013-Fix-build.patch similarity index 94% rename from SOURCES/0026-Fix-build.patch rename to SOURCES/0013-Fix-build.patch index d401d84..d69114b 100644 --- a/SOURCES/0026-Fix-build.patch +++ b/SOURCES/0013-Fix-build.patch @@ -1,7 +1,7 @@ -From a8ddf1a7296e2d28b36231a391807226a7329ae4 Mon Sep 17 00:00:00 2001 +From 2e8e8b87d800f1ef2e0fb0a6f0818de0a8fa0951 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 14 Jun 2021 12:45:37 +0100 -Subject: [PATCH 26/36] Fix build +Subject: [PATCH 13/40] Fix build 1b5e43a593e917610e6245f7a272ac081c508ba4 relied on a patch that we can't backport. @@ -42,5 +42,5 @@ index 69cc46a0..9091efbe 100644 class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionTemplatePrivate : public QWaylandClientExtensionPrivate -- -2.33.1 +2.35.1 diff --git a/SOURCES/0027-Fix-remove-listener.patch b/SOURCES/0014-Fix-remove-listener.patch similarity index 91% rename from SOURCES/0027-Fix-remove-listener.patch rename to SOURCES/0014-Fix-remove-listener.patch index fbe2342..f95a3bb 100644 --- a/SOURCES/0027-Fix-remove-listener.patch +++ b/SOURCES/0014-Fix-remove-listener.patch @@ -1,7 +1,7 @@ -From d1c4a459faa1d514026c4834828cb33024ac2ceb Mon Sep 17 00:00:00 2001 +From 88b2e6c9728d01a9aa334026629fbb1ce85fe197 Mon Sep 17 00:00:00 2001 From: Zhang Liang Date: Mon, 1 Feb 2021 19:29:43 +0800 -Subject: [PATCH 27/36] Fix: remove listener +Subject: [PATCH 14/40] Fix: remove listener Add the operation for removing the listener form listener list @@ -29,5 +29,5 @@ index f10c1f79..e0dfe8b2 100644 uint32_t QWaylandDisplay::currentTimeMillisec() -- -2.33.1 +2.35.1 diff --git a/SOURCES/0028-Hook-up-queryKeyboardModifers.patch b/SOURCES/0015-Hook-up-queryKeyboardModifers.patch similarity index 93% rename from SOURCES/0028-Hook-up-queryKeyboardModifers.patch rename to SOURCES/0015-Hook-up-queryKeyboardModifers.patch index 7e074c9..46b5c11 100644 --- a/SOURCES/0028-Hook-up-queryKeyboardModifers.patch +++ b/SOURCES/0015-Hook-up-queryKeyboardModifers.patch @@ -1,7 +1,7 @@ -From a6476d1a1c78eb7f17408241b268404e27b3e161 Mon Sep 17 00:00:00 2001 +From 75693b47dcac101f74f98e5902c4c6b39d407e4f Mon Sep 17 00:00:00 2001 From: David Redondo Date: Wed, 26 May 2021 14:49:40 +0200 -Subject: [PATCH 28/36] Hook up queryKeyboardModifers +Subject: [PATCH 15/40] 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.33.1 +2.35.1 diff --git a/SOURCES/0029-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch b/SOURCES/0016-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch similarity index 89% rename from SOURCES/0029-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch rename to SOURCES/0016-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch index 9764d9b..12085f8 100644 --- a/SOURCES/0029-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch +++ b/SOURCES/0016-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch @@ -1,7 +1,7 @@ -From d4c41797b61a5a8da47c5821711aca72e756dcbf Mon Sep 17 00:00:00 2001 +From 537c5d43941d26d89ebf00f6abf7f12f9bac1caf Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 13 Jul 2021 13:32:15 +0200 -Subject: [PATCH 29/36] Do not update the mask if we do not have a surface +Subject: [PATCH 16/40] Do not update the mask if we do not have a surface mMask serves as a cache to remember what we've sent, the source of truth for the value is window()->mask(). @@ -40,5 +40,5 @@ index e96d8fe9..bd70f4af 100644 mSurface->set_input_region(nullptr); -- -2.33.1 +2.35.1 diff --git a/SOURCES/0030-Correctly-detect-if-image-format-is-supported-by-QIm.patch b/SOURCES/0017-Correctly-detect-if-image-format-is-supported-by-QIm.patch similarity index 95% rename from SOURCES/0030-Correctly-detect-if-image-format-is-supported-by-QIm.patch rename to SOURCES/0017-Correctly-detect-if-image-format-is-supported-by-QIm.patch index ceea624..c6b939a 100644 --- a/SOURCES/0030-Correctly-detect-if-image-format-is-supported-by-QIm.patch +++ b/SOURCES/0017-Correctly-detect-if-image-format-is-supported-by-QIm.patch @@ -1,7 +1,7 @@ -From 3c420cd180397e3f42c8a436a7f1b11465925bdd Mon Sep 17 00:00:00 2001 +From ae3ea8875b9475532e5779154e3992affe2b9a32 Mon Sep 17 00:00:00 2001 From: Jan Blackquill Date: Tue, 24 Aug 2021 14:36:34 -0400 -Subject: [PATCH 30/36] Correctly detect if image format is supported by +Subject: [PATCH 17/40] Correctly detect if image format is supported by QImageWriter The code queries potential image formats by stripping a mimetype of its @@ -64,5 +64,5 @@ index a5fdd34d..051a91dc 100644 fmt = imgFmt; } -- -2.33.1 +2.35.1 diff --git a/SOURCES/0018-Fix-compilation.patch b/SOURCES/0018-Fix-compilation.patch deleted file mode 100644 index edbb55f..0000000 --- a/SOURCES/0018-Fix-compilation.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 2f84a874da064069461284db1da36dc818949ec1 Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -Date: Sat, 10 Apr 2021 12:10:16 +0200 -Subject: [PATCH 18/36] Fix compilation - -9df11e79b46c77d8c83f765b2a8e85b639fd55a2 can't be backported 1:1 ---- - .../client/wayland-egl/qwaylandglcontext.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -index befadedc..95d1049c 100644 ---- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -@@ -408,7 +408,7 @@ QWaylandGLContext::~QWaylandGLContext() - delete m_blitter; - m_blitter = nullptr; - if (m_decorationsContext != EGL_NO_CONTEXT) -- eglDestroyContext(eglDisplay(), m_decorationsContext); -+ eglDestroyContext(m_eglDisplay, m_decorationsContext); - } - - bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) --- -2.33.1 - diff --git a/SOURCES/0031-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch b/SOURCES/0018-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch similarity index 88% rename from SOURCES/0031-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch rename to SOURCES/0018-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch index b5df11c..386de42 100644 --- a/SOURCES/0031-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch +++ b/SOURCES/0018-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch @@ -1,7 +1,7 @@ -From 1c53ba6dfebbf1d6e87c9ad1f2bbda94e3d45bf7 Mon Sep 17 00:00:00 2001 +From 8d673fe2edebe2c5bf338a779ef22ae212dc244a Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 14 Sep 2021 11:56:23 +0200 -Subject: [PATCH 31/36] Wayland client: Fix crash when windows are shown/hidden +Subject: [PATCH 18/40] Wayland client: Fix crash when windows are shown/hidden during drag Fixes: QTBUG-87624 @@ -27,5 +27,5 @@ index 54a69c3c..bbd2d568 100644 return; // Ignore foreign surfaces -- -2.33.1 +2.35.1 diff --git a/SOURCES/0032-Client-Don-t-always-recreate-frame-callbacks.patch b/SOURCES/0019-Client-Don-t-always-recreate-frame-callbacks.patch similarity index 96% rename from SOURCES/0032-Client-Don-t-always-recreate-frame-callbacks.patch rename to SOURCES/0019-Client-Don-t-always-recreate-frame-callbacks.patch index 4789fe8..1c8bd50 100644 --- a/SOURCES/0032-Client-Don-t-always-recreate-frame-callbacks.patch +++ b/SOURCES/0019-Client-Don-t-always-recreate-frame-callbacks.patch @@ -1,7 +1,7 @@ -From 3be586cd8b6c8313cb6b8b7d61be17706f79590e Mon Sep 17 00:00:00 2001 +From bdd2dacf2d8668b3a1f59db3c6cc859f95868eb2 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 27 May 2021 19:55:04 -0300 -Subject: [PATCH 32/36] Client: Don't always recreate frame callbacks +Subject: [PATCH 19/40] 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 @@ -73,5 +73,5 @@ index 2fdd0a7c..e2593314 100644 void tst_xdgshell::popup() -- -2.33.1 +2.35.1 diff --git a/SOURCES/0033-Client-Always-destroy-frame-callback-in-the-actual-c.patch b/SOURCES/0020-Client-Always-destroy-frame-callback-in-the-actual-c.patch similarity index 93% rename from SOURCES/0033-Client-Always-destroy-frame-callback-in-the-actual-c.patch rename to SOURCES/0020-Client-Always-destroy-frame-callback-in-the-actual-c.patch index 8446b4e..72c6c8d 100644 --- a/SOURCES/0033-Client-Always-destroy-frame-callback-in-the-actual-c.patch +++ b/SOURCES/0020-Client-Always-destroy-frame-callback-in-the-actual-c.patch @@ -1,7 +1,7 @@ -From efe6edcaf8eba601dff99ec6ad4457c8a4442f86 Mon Sep 17 00:00:00 2001 +From fb0a5265ec9d83b56563769cc1b756aeca42ce65 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 27 May 2021 20:02:53 -0300 -Subject: [PATCH 33/36] Client: Always destroy frame callback in the actual +Subject: [PATCH 20/40] Client: Always destroy frame callback in the actual callback It's good hygiene to destroy all frame callbacks. Destroy the @@ -54,5 +54,5 @@ index 85307875..c020a58f 100644 struct ::wl_surface *wrappedSurface = reinterpret_cast(wl_proxy_create_wrapper(mSurface->object())); wl_proxy_set_queue(reinterpret_cast(wrappedSurface), mFrameQueue.queue); -- -2.33.1 +2.35.1 diff --git a/SOURCES/0034-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch b/SOURCES/0021-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch similarity index 90% rename from SOURCES/0034-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch rename to SOURCES/0021-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch index 47ac957..958be61 100644 --- a/SOURCES/0034-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch +++ b/SOURCES/0021-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch @@ -1,7 +1,7 @@ -From 02f9585ca19c17ae0978b864195533dc527d825e Mon Sep 17 00:00:00 2001 +From 1e0519c6465335dd380ad8d8209969c71eb78d48 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Fri, 15 Oct 2021 12:55:33 -0400 -Subject: [PATCH 34/36] Fix the logic for decoding modifiers map in Wayland +Subject: [PATCH 21/40] Fix the logic for decoding modifiers map in Wayland text input protocol Correctly check for the flags in the modifiers map when we get it from @@ -36,5 +36,5 @@ index 503fd735..e290baa2 100644 return ret; } -- -2.33.1 +2.35.1 diff --git a/SOURCES/0035-Wayland-client-use-wl_keyboard-to-determine-active-s.patch b/SOURCES/0022-Wayland-client-use-wl_keyboard-to-determine-active-s.patch similarity index 99% rename from SOURCES/0035-Wayland-client-use-wl_keyboard-to-determine-active-s.patch rename to SOURCES/0022-Wayland-client-use-wl_keyboard-to-determine-active-s.patch index b8d1207..73d79fb 100644 --- a/SOURCES/0035-Wayland-client-use-wl_keyboard-to-determine-active-s.patch +++ b/SOURCES/0022-Wayland-client-use-wl_keyboard-to-determine-active-s.patch @@ -1,7 +1,7 @@ -From 5c180bdc1042e7cb1555e188051f09e219b00ec9 Mon Sep 17 00:00:00 2001 +From 64e133f830ce48b6732397325b768ed9193c2cb4 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 35/36] Wayland client: use wl_keyboard to determine active +Subject: [PATCH 22/40] Wayland client: use wl_keyboard to determine active state Commit f497a5bb87270174b8e0106b7eca1992d44ff15d made QWaylandDisplay @@ -337,5 +337,5 @@ index e2593314..73d1eb9c 100644 const QSize screenSize(640, 480); const uint maximizedSerial = exec([=] { -- -2.33.1 +2.35.1 diff --git a/SOURCES/0036-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch b/SOURCES/0023-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch similarity index 94% rename from SOURCES/0036-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch rename to SOURCES/0023-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch index c0cbefc..1ee617a 100644 --- a/SOURCES/0036-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch +++ b/SOURCES/0023-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch @@ -1,7 +1,7 @@ -From 992833ca741efe8f533c61abfaf129a1d8bfcfee Mon Sep 17 00:00:00 2001 +From 167a89d23d4db6f62ef8336002fe306829604a77 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Fri, 16 Jul 2021 13:00:03 +0200 -Subject: [PATCH 36/36] Client: do not empty clipboard when a new popup/window +Subject: [PATCH 23/40] 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 @@ -64,5 +64,5 @@ index ae045f4f..514457e9 100644 mRepeatTimer.stop(); } -- -2.33.1 +2.35.1 diff --git a/SOURCES/0038-Set-preedit-cursor-when-cursor-equals-to-0.patch b/SOURCES/0024-Set-preedit-cursor-when-cursor-equals-to-0.patch similarity index 89% rename from SOURCES/0038-Set-preedit-cursor-when-cursor-equals-to-0.patch rename to SOURCES/0024-Set-preedit-cursor-when-cursor-equals-to-0.patch index 352d13d..454f6dd 100644 --- a/SOURCES/0038-Set-preedit-cursor-when-cursor-equals-to-0.patch +++ b/SOURCES/0024-Set-preedit-cursor-when-cursor-equals-to-0.patch @@ -1,7 +1,7 @@ -From e0646f531e1e73a90a93faaa45d933ae40769985 Mon Sep 17 00:00:00 2001 +From 5ea11ccde21448f5c61978bf52e2f3db79a7143c Mon Sep 17 00:00:00 2001 From: Weng Xuetian Date: Sat, 18 Dec 2021 23:42:49 -0800 -Subject: [PATCH 38/41] Set preedit cursor when cursor equals to 0 +Subject: [PATCH 24/40] Set preedit cursor when cursor equals to 0 Pick-to: 6.3 6.2 5.15 Change-Id: I832fbb22d973b36ac4ab51570fc53bc2e4c3ed58 @@ -25,5 +25,5 @@ index 526d0ef4..25be2509 100644 } else if (m_preeditCursor > 0) { attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, indexFromWayland(text, m_preeditCursor), 1, QVariant())); -- -2.34.1 +2.35.1 diff --git a/SOURCES/0039-Client-Implement-DataDeviceV3.patch b/SOURCES/0025-Client-Implement-DataDeviceV3.patch similarity index 99% rename from SOURCES/0039-Client-Implement-DataDeviceV3.patch rename to SOURCES/0025-Client-Implement-DataDeviceV3.patch index 0efe269..42245c2 100644 --- a/SOURCES/0039-Client-Implement-DataDeviceV3.patch +++ b/SOURCES/0025-Client-Implement-DataDeviceV3.patch @@ -1,7 +1,7 @@ -From 2044603ebb5ae70c785d50968ac620b842c2b14e Mon Sep 17 00:00:00 2001 +From 95783492ae8df7f84c3c13351df5dc114288e96e Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 16 Feb 2021 09:51:47 +0000 -Subject: [PATCH 39/41] Client: Implement DataDeviceV3 +Subject: [PATCH 25/40] Client: Implement DataDeviceV3 DataDeviceV2 fixes a leak of DataDevice resources. @@ -509,5 +509,5 @@ index 1568b3b9..067410d0 100644 class DataDeviceCompositor : public DefaultCompositor { public: -- -2.34.1 +2.35.1 diff --git a/SOURCES/0040-Client-Delay-deletion-of-QDrag-object-until-after-we.patch b/SOURCES/0026-Client-Delay-deletion-of-QDrag-object-until-after-we.patch similarity index 93% rename from SOURCES/0040-Client-Delay-deletion-of-QDrag-object-until-after-we.patch rename to SOURCES/0026-Client-Delay-deletion-of-QDrag-object-until-after-we.patch index 537286a..fb1cffa 100644 --- a/SOURCES/0040-Client-Delay-deletion-of-QDrag-object-until-after-we.patch +++ b/SOURCES/0026-Client-Delay-deletion-of-QDrag-object-until-after-we.patch @@ -1,7 +1,7 @@ -From 0b15df7e9e26a4edfc2277eb3ec7b3d5c58a5dcd Mon Sep 17 00:00:00 2001 +From 8c9e148bb0aa25cbc831e2bd931d3bd54bc0fb46 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 18 Nov 2021 13:05:30 +0100 -Subject: [PATCH 40/41] Client: Delay deletion of QDrag object until after +Subject: [PATCH 26/40] 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.34.1 +2.35.1 diff --git a/SOURCES/0041-Client-Avoid-processing-of-events-when-showing-windo.patch b/SOURCES/0027-Client-Avoid-processing-of-events-when-showing-windo.patch similarity index 91% rename from SOURCES/0041-Client-Avoid-processing-of-events-when-showing-windo.patch rename to SOURCES/0027-Client-Avoid-processing-of-events-when-showing-windo.patch index 7e683b8..ea7bb59 100644 --- a/SOURCES/0041-Client-Avoid-processing-of-events-when-showing-windo.patch +++ b/SOURCES/0027-Client-Avoid-processing-of-events-when-showing-windo.patch @@ -1,7 +1,7 @@ -From 867540b9d913760a847ff67c8694d817c821f2c2 Mon Sep 17 00:00:00 2001 +From b736b4488dcaa1a3c6b0c6059e5b85881f74c52b Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Sun, 14 Nov 2021 13:54:19 +0000 -Subject: [PATCH 41/41] Client: Avoid processing of events when showing windows +Subject: [PATCH 27/40] 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 @@ -34,5 +34,5 @@ index ba881cb3..1597f67e 100644 setGeometry(windowGeometry()); // Don't flush the events here, or else the newly visible window may start drawing, but since -- -2.34.1 +2.35.1 diff --git a/SOURCES/0028-Handle-registry_global-out-of-constructor.patch b/SOURCES/0028-Handle-registry_global-out-of-constructor.patch new file mode 100644 index 0000000..a7dc153 --- /dev/null +++ b/SOURCES/0028-Handle-registry_global-out-of-constructor.patch @@ -0,0 +1,85 @@ +From 771705eee02b4d752beee22ef5408ccbd72078cc Mon Sep 17 00:00:00 2001 +From: Elvis Lee +Date: Thu, 18 Feb 2021 15:45:49 +0900 +Subject: [PATCH 28/40] 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 +platform specific implementation with inheritance and some factory function. + +Change-Id: I92ce574e049b8c91587687cc7c30611f3dfdbe56 +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit 3793a82038682db77966ea5daf8e75964e4250fe) +--- + src/client/qwaylanddisplay.cpp | 19 ++++++++++++------- + src/client/qwaylanddisplay_p.h | 2 ++ + src/client/qwaylandintegration.cpp | 3 +++ + 3 files changed, 17 insertions(+), 7 deletions(-) + +diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp +index ea344c61..0f75cb7e 100644 +--- a/src/client/qwaylanddisplay.cpp ++++ b/src/client/qwaylanddisplay.cpp +@@ -158,13 +158,6 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) + if (!mXkbContext) + qCWarning(lcQpaWayland, "failed to create xkb context"); + #endif +- +- forceRoundTrip(); +- +- if (!mWaitingScreens.isEmpty()) { +- // Give wl_output.done and zxdg_output_v1.done events a chance to arrive +- forceRoundTrip(); +- } + } + + QWaylandDisplay::~QWaylandDisplay(void) +@@ -189,6 +182,18 @@ QWaylandDisplay::~QWaylandDisplay(void) + wl_display_disconnect(mDisplay); + } + ++// Steps which is called just after constructor. This separates registry_global() out of the constructor ++// so that factory functions in integration can be overridden. ++void QWaylandDisplay::initialize() ++{ ++ forceRoundTrip(); ++ ++ if (!mWaitingScreens.isEmpty()) { ++ // Give wl_output.done and zxdg_output_v1.done events a chance to arrive ++ forceRoundTrip(); ++ } ++} ++ + void QWaylandDisplay::ensureScreen() + { + if (!mScreens.empty() || mPlaceholderScreen) +diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h +index 09a1736a..d9c8849f 100644 +--- a/src/client/qwaylanddisplay_p.h ++++ b/src/client/qwaylanddisplay_p.h +@@ -129,6 +129,8 @@ public: + QWaylandDisplay(QWaylandIntegration *waylandIntegration); + ~QWaylandDisplay(void) override; + ++ void initialize(); ++ + #if QT_CONFIG(xkbcommon) + struct xkb_context *xkbContext() const { return mXkbContext.get(); } + #endif +diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp +index e5e7dd42..f5632982 100644 +--- a/src/client/qwaylandintegration.cpp ++++ b/src/client/qwaylandintegration.cpp +@@ -200,6 +200,9 @@ void QWaylandIntegration::initialize() + QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data()); + QObject::connect(sn, SIGNAL(activated(QSocketDescriptor)), mDisplay.data(), SLOT(flushRequests())); + ++ // Call after eventDispatcher is fully connected, for QWaylandDisplay::forceRoundTrip() ++ mDisplay->initialize(); ++ + // Qt does not support running with no screens + mDisplay->ensureScreen(); + } +-- +2.35.1 + diff --git a/SOURCES/0029-Connect-flushRequest-after-forceRoundTrip.patch b/SOURCES/0029-Connect-flushRequest-after-forceRoundTrip.patch new file mode 100644 index 0000000..7a09ad3 --- /dev/null +++ b/SOURCES/0029-Connect-flushRequest-after-forceRoundTrip.patch @@ -0,0 +1,47 @@ +From 725c5de6bdd528d1fa03f1de5ec91585eb110d83 Mon Sep 17 00:00:00 2001 +From: Elvis Lee +Date: Wed, 17 Mar 2021 16:31:10 +0900 +Subject: [PATCH 29/40] Connect flushRequest after forceRoundTrip + +If flushRequest is connected with aboutToBlock, the flushRequest +may consumes all events so that processEvents might be blocked in forceRoundTrip. + +Change-Id: I12b2c506e8442bf0e75f6ab6e418d3e1eea6d68c +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit 654a54755138c520c3a41210d8078196e9a2c1bf) +--- + src/client/qwaylandintegration.cpp | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp +index f5632982..3a6fa651 100644 +--- a/src/client/qwaylandintegration.cpp ++++ b/src/client/qwaylandintegration.cpp +@@ -192,10 +192,6 @@ QAbstractEventDispatcher *QWaylandIntegration::createEventDispatcher() const + + void QWaylandIntegration::initialize() + { +- QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher; +- QObject::connect(dispatcher, SIGNAL(aboutToBlock()), mDisplay.data(), SLOT(flushRequests())); +- QObject::connect(dispatcher, SIGNAL(awake()), mDisplay.data(), SLOT(flushRequests())); +- + int fd = wl_display_get_fd(mDisplay->wl_display()); + QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data()); + QObject::connect(sn, SIGNAL(activated(QSocketDescriptor)), mDisplay.data(), SLOT(flushRequests())); +@@ -203,6 +199,13 @@ void QWaylandIntegration::initialize() + // Call after eventDispatcher is fully connected, for QWaylandDisplay::forceRoundTrip() + mDisplay->initialize(); + ++ // But the aboutToBlock() and awake() should be connected after initializePlatform(). ++ // Otherwise the connected flushRequests() may consumes up all events before processEvents starts to wait, ++ // so that processEvents(QEventLoop::WaitForMoreEvents) may be blocked in the forceRoundTrip(). ++ QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher; ++ QObject::connect(dispatcher, SIGNAL(aboutToBlock()), mDisplay.data(), SLOT(flushRequests())); ++ QObject::connect(dispatcher, SIGNAL(awake()), mDisplay.data(), SLOT(flushRequests())); ++ + // Qt does not support running with no screens + mDisplay->ensureScreen(); + } +-- +2.35.1 + diff --git a/SOURCES/0030-Move-the-wayland-socket-polling-to-a-separate-event-.patch b/SOURCES/0030-Move-the-wayland-socket-polling-to-a-separate-event-.patch new file mode 100644 index 0000000..c71b532 --- /dev/null +++ b/SOURCES/0030-Move-the-wayland-socket-polling-to-a-separate-event-.patch @@ -0,0 +1,574 @@ +From 91d36a2497f3289996d788c8974583bccac3c842 Mon Sep 17 00:00:00 2001 +From: Adrien Faveraux +Date: Fri, 26 Nov 2021 09:18:58 +0100 +Subject: [PATCH 30/40] Move the wayland socket polling to a separate event + thread + +New event threads is introduced which calls poll() on the wayland fd, +instead of relying on the event dispatcher by using the QSocketNotifier. +This allows to call in the proper order the wl_display_prepare_read(), +poll() and wl_display_read_events() functions. + +One thread is responsible for the default queue; when needed, it emit +a signal so that the main thread can dispatch the queue. Another thread +is responsible for the dedicated queue for frame callbacks; this thread +will dispatch events on the thread itself. + +QWaylandWindow is updated to, instead of each window's dedicated event +queue, use this queue for frame callbacks. + +Co-authored-by: Ratchanan Srirattanamet +Task-number: QTBUG-66075 +Change-Id: Ibb33ad7f4193b866d1b8d7a0405a94d59dcad5eb +Reviewed-by: Qt CI Bot +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit 92a7904d9651348b0c307e84251c8440c6f75b22) +--- + src/client/qwaylanddisplay.cpp | 302 +++++++++++++++++++++-------- + src/client/qwaylanddisplay_p.h | 21 +- + src/client/qwaylandintegration.cpp | 4 +- + src/client/qwaylandwindow.cpp | 34 +++- + src/client/qwaylandwindow_p.h | 2 +- + 5 files changed, 255 insertions(+), 108 deletions(-) + +diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp +index 0f75cb7e..a7ce280a 100644 +--- a/src/client/qwaylanddisplay.cpp ++++ b/src/client/qwaylanddisplay.cpp +@@ -85,10 +85,203 @@ + + #include + ++#include // for std::tie ++ ++static void checkWaylandError(struct wl_display *display) ++{ ++ int ecode = wl_display_get_error(display); ++ if ((ecode == EPIPE || ecode == ECONNRESET)) { ++ // special case this to provide a nicer error ++ qWarning("The Wayland connection broke. Did the Wayland compositor die?"); ++ } else { ++ qWarning("The Wayland connection experienced a fatal error: %s", strerror(ecode)); ++ } ++ _exit(1); ++} ++ + QT_BEGIN_NAMESPACE + + namespace QtWaylandClient { + ++class EventThread : public QThread ++{ ++ Q_OBJECT ++public: ++ enum OperatingMode { ++ EmitToDispatch, // Emit the signal, allow dispatching in a differnt thread. ++ SelfDispatch, // Dispatch the events inside this thread. ++ }; ++ ++ EventThread(struct wl_display * wl, struct wl_event_queue * ev_queue, ++ OperatingMode mode) ++ : m_fd(wl_display_get_fd(wl)) ++ , m_pipefd{ -1, -1 } ++ , m_wldisplay(wl) ++ , m_wlevqueue(ev_queue) ++ , m_mode(mode) ++ , m_reading(true) ++ , m_quitting(false) ++ { ++ setObjectName(QStringLiteral("WaylandEventThread")); ++ } ++ ++ void readAndDispatchEvents() ++ { ++ /* ++ * Dispatch pending events and flush the requests at least once. If the event thread ++ * is not reading, try to call _prepare_read() to allow the event thread to poll(). ++ * If that fails, re-try dispatch & flush again until _prepare_read() is successful. ++ * ++ * This allow any call to readAndDispatchEvents() to start event thread's polling, ++ * not only the one issued from event thread's waitForReading(), which means functions ++ * called from dispatch_pending() can safely spin an event loop. ++ */ ++ for (;;) { ++ if (dispatchQueuePending() < 0) { ++ checkWaylandError(m_wldisplay); ++ return; ++ } ++ ++ wl_display_flush(m_wldisplay); ++ ++ // We have to check if event thread is reading every time we dispatch ++ // something, as that may recursively call this function. ++ if (m_reading.loadAcquire()) ++ break; ++ ++ if (prepareReadQueue() == 0) { ++ QMutexLocker l(&m_mutex); ++ m_reading.storeRelease(true); ++ m_cond.wakeOne(); ++ break; ++ } ++ } ++ } ++ ++ void stop() ++ { ++ // We have to both write to the pipe and set the flag, as the thread may be ++ // either in the poll() or waiting for _prepare_read(). ++ if (m_pipefd[1] != -1 && write(m_pipefd[1], "\0", 1) == -1) ++ qWarning("Failed to write to the pipe: %s.", strerror(errno)); ++ ++ { ++ QMutexLocker l(&m_mutex); ++ m_quitting = true; ++ m_cond.wakeOne(); ++ } ++ ++ wait(); ++ } ++ ++Q_SIGNALS: ++ void needReadAndDispatch(); ++ ++protected: ++ void run() override ++ { ++ // we use this pipe to make the loop exit otherwise if we simply used a flag on the loop condition, if stop() gets ++ // called while poll() is blocking the thread will never quit since there are no wayland messages coming anymore. ++ struct Pipe ++ { ++ Pipe(int *fds) ++ : fds(fds) ++ { ++ if (qt_safe_pipe(fds) != 0) ++ qWarning("Pipe creation failed. Quitting may hang."); ++ } ++ ~Pipe() ++ { ++ if (fds[0] != -1) { ++ close(fds[0]); ++ close(fds[1]); ++ } ++ } ++ ++ int *fds; ++ } pipe(m_pipefd); ++ ++ // Make the main thread call wl_prepare_read(), dispatch the pending messages and flush the ++ // outbound ones. Wait until it's done before proceeding, unless we're told to quit. ++ while (waitForReading()) { ++ pollfd fds[2] = { { m_fd, POLLIN, 0 }, { m_pipefd[0], POLLIN, 0 } }; ++ poll(fds, 2, -1); ++ ++ if (fds[1].revents & POLLIN) { ++ // we don't really care to read the byte that was written here since we're closing down ++ wl_display_cancel_read(m_wldisplay); ++ break; ++ } ++ ++ if (fds[0].revents & POLLIN) ++ wl_display_read_events(m_wldisplay); ++ // The polll was succesfull and the event thread did the wl_display_read_events(). On the next iteration of the loop ++ // the event sent to the main thread will cause it to dispatch the messages just read, unless the loop exits in which ++ // case we don't care anymore about them. ++ else ++ wl_display_cancel_read(m_wldisplay); ++ } ++ } ++ ++private: ++ bool waitForReading() ++ { ++ Q_ASSERT(QThread::currentThread() == this); ++ ++ m_reading.storeRelease(false); ++ ++ if (m_mode == SelfDispatch) { ++ readAndDispatchEvents(); ++ } else { ++ Q_EMIT needReadAndDispatch(); ++ ++ QMutexLocker lock(&m_mutex); ++ // m_reading might be set from our emit or some other invocation of ++ // readAndDispatchEvents(). ++ while (!m_reading.loadRelaxed() && !m_quitting) ++ m_cond.wait(&m_mutex); ++ } ++ ++ return !m_quitting; ++ } ++ ++ int dispatchQueuePending() ++ { ++ if (m_wlevqueue) ++ return wl_display_dispatch_queue_pending(m_wldisplay, m_wlevqueue); ++ else ++ return wl_display_dispatch_pending(m_wldisplay); ++ } ++ ++ int prepareReadQueue() ++ { ++ if (m_wlevqueue) ++ return wl_display_prepare_read_queue(m_wldisplay, m_wlevqueue); ++ else ++ return wl_display_prepare_read(m_wldisplay); ++ } ++ ++ int m_fd; ++ int m_pipefd[2]; ++ wl_display *m_wldisplay; ++ wl_event_queue *m_wlevqueue; ++ OperatingMode m_mode; ++ ++ /* Concurrency note when operating in EmitToDispatch mode: ++ * m_reading is set to false inside event thread's waitForReading(), and is ++ * set to true inside main thread's readAndDispatchEvents(). ++ * The lock is not taken when setting m_reading to false, as the main thread ++ * is not actively waiting for it to turn false. However, the lock is taken ++ * inside readAndDispatchEvents() before setting m_reading to true, ++ * as the event thread is actively waiting for it under the wait condition. ++ */ ++ ++ QAtomicInteger m_reading; ++ bool m_quitting; ++ QMutex m_mutex; ++ QWaitCondition m_cond; ++}; ++ + Q_LOGGING_CATEGORY(lcQpaWayland, "qt.qpa.wayland"); // for general (uncategorized) Wayland platform logging + + struct wl_surface *QWaylandDisplay::createSurface(void *handle) +@@ -162,6 +355,12 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) + + QWaylandDisplay::~QWaylandDisplay(void) + { ++ if (m_eventThread) ++ m_eventThread->stop(); ++ ++ if (m_frameEventQueueThread) ++ m_frameEventQueueThread->stop(); ++ + if (mSyncCallback) + wl_callback_destroy(mSyncCallback); + +@@ -208,98 +407,37 @@ void QWaylandDisplay::ensureScreen() + + void QWaylandDisplay::checkError() const + { +- int ecode = wl_display_get_error(mDisplay); +- if ((ecode == EPIPE || ecode == ECONNRESET)) { +- // special case this to provide a nicer error +- qWarning("The Wayland connection broke. Did the Wayland compositor die?"); +- } else { +- qWarning("The Wayland connection experienced a fatal error: %s", strerror(ecode)); +- } +- _exit(1); ++ checkWaylandError(mDisplay); + } + ++// Called in main thread, either from queued signal or directly. + void QWaylandDisplay::flushRequests() + { +- if (wl_display_prepare_read(mDisplay) == 0) { +- wl_display_read_events(mDisplay); +- } +- +- if (wl_display_dispatch_pending(mDisplay) < 0) +- checkError(); +- +- { +- QReadLocker locker(&m_frameQueueLock); +- for (const FrameQueue &q : mExternalQueues) { +- QMutexLocker locker(q.mutex); +- while (wl_display_prepare_read_queue(mDisplay, q.queue) != 0) +- wl_display_dispatch_queue_pending(mDisplay, q.queue); +- wl_display_read_events(mDisplay); +- wl_display_dispatch_queue_pending(mDisplay, q.queue); +- } +- } +- +- wl_display_flush(mDisplay); +-} +- +-void QWaylandDisplay::blockingReadEvents() +-{ +- if (wl_display_dispatch(mDisplay) < 0) +- checkError(); +-} +- +-void QWaylandDisplay::destroyFrameQueue(const QWaylandDisplay::FrameQueue &q) +-{ +- QWriteLocker locker(&m_frameQueueLock); +- auto it = std::find_if(mExternalQueues.begin(), +- mExternalQueues.end(), +- [&q] (const QWaylandDisplay::FrameQueue &other){ return other.queue == q.queue; }); +- Q_ASSERT(it != mExternalQueues.end()); +- mExternalQueues.erase(it); +- if (q.queue != nullptr) +- wl_event_queue_destroy(q.queue); +- delete q.mutex; ++ m_eventThread->readAndDispatchEvents(); + } + +-QWaylandDisplay::FrameQueue QWaylandDisplay::createFrameQueue() ++// We have to wait until we have an eventDispatcher before creating the eventThread, ++// otherwise forceRoundTrip() may block inside _events_read() because eventThread is ++// polling. ++void QWaylandDisplay::initEventThread() + { +- QWriteLocker locker(&m_frameQueueLock); +- FrameQueue q{createEventQueue()}; +- mExternalQueues.append(q); +- return q; +-} ++ m_eventThread.reset( ++ new EventThread(mDisplay, /* default queue */ nullptr, EventThread::EmitToDispatch)); ++ connect(m_eventThread.get(), &EventThread::needReadAndDispatch, this, ++ &QWaylandDisplay::flushRequests, Qt::QueuedConnection); ++ m_eventThread->start(); + +-wl_event_queue *QWaylandDisplay::createEventQueue() +-{ +- return wl_display_create_queue(mDisplay); ++ // wl_display_disconnect() free this. ++ m_frameEventQueue = wl_display_create_queue(mDisplay); ++ m_frameEventQueueThread.reset( ++ new EventThread(mDisplay, m_frameEventQueue, EventThread::SelfDispatch)); ++ m_frameEventQueueThread->start(); + } + +-void QWaylandDisplay::dispatchQueueWhile(wl_event_queue *queue, std::function condition, int timeout) ++void QWaylandDisplay::blockingReadEvents() + { +- if (!condition()) +- return; +- +- QElapsedTimer timer; +- timer.start(); +- struct pollfd pFd = qt_make_pollfd(wl_display_get_fd(mDisplay), POLLIN); +- while (timeout == -1 || timer.elapsed() < timeout) { +- while (wl_display_prepare_read_queue(mDisplay, queue) != 0) +- wl_display_dispatch_queue_pending(mDisplay, queue); +- +- wl_display_flush(mDisplay); +- +- const int remaining = qMax(timeout - timer.elapsed(), 0ll); +- const int pollTimeout = timeout == -1 ? -1 : remaining; +- if (qt_poll_msecs(&pFd, 1, pollTimeout) > 0) +- wl_display_read_events(mDisplay); +- else +- wl_display_cancel_read(mDisplay); +- +- if (wl_display_dispatch_queue_pending(mDisplay, queue) < 0) +- checkError(); +- +- if (!condition()) +- break; +- } ++ if (wl_display_dispatch(mDisplay) < 0) ++ checkWaylandError(mDisplay); + } + + QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const +@@ -674,4 +812,6 @@ QWaylandCursorTheme *QWaylandDisplay::loadCursorTheme(const QString &name, int p + + } // namespace QtWaylandClient + ++#include "qwaylanddisplay.moc" ++ + QT_END_NAMESPACE +diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h +index d9c8849f..42bc661d 100644 +--- a/src/client/qwaylanddisplay_p.h ++++ b/src/client/qwaylanddisplay_p.h +@@ -109,6 +109,7 @@ class QWaylandSurface; + class QWaylandShellIntegration; + class QWaylandCursor; + class QWaylandCursorTheme; ++class EventThread; + + typedef void (*RegistryListener)(void *data, + struct wl_registry *registry, +@@ -120,12 +121,6 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandDisplay : public QObject, public QtWayland + Q_OBJECT + + public: +- struct FrameQueue { +- FrameQueue(wl_event_queue *q = nullptr) : queue(q), mutex(new QMutex) {} +- wl_event_queue *queue; +- QMutex *mutex; +- }; +- + QWaylandDisplay(QWaylandIntegration *waylandIntegration); + ~QWaylandDisplay(void) override; + +@@ -212,12 +207,11 @@ public: + void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice); + void handleWindowDestroyed(QWaylandWindow *window); + +- wl_event_queue *createEventQueue(); +- FrameQueue createFrameQueue(); +- void destroyFrameQueue(const FrameQueue &q); +- void dispatchQueueWhile(wl_event_queue *queue, std::function condition, int timeout = -1); ++ wl_event_queue *frameEventQueue() { return m_frameEventQueue; }; + + bool isKeyboardAvailable() const; ++ ++ void initEventThread(); + public slots: + void blockingReadEvents(); + void flushRequests(); +@@ -240,6 +234,9 @@ private: + }; + + struct wl_display *mDisplay = nullptr; ++ QScopedPointer m_eventThread; ++ wl_event_queue *m_frameEventQueue = nullptr; ++ QScopedPointer m_frameEventQueueThread; + QtWayland::wl_compositor mCompositor; + QScopedPointer mShm; + QList mWaitingScreens; +@@ -276,11 +273,9 @@ private: + QWaylandInputDevice *mLastInputDevice = nullptr; + QPointer mLastInputWindow; + QPointer mLastKeyboardFocus; +- QVector mActiveWindows; +- QVector mExternalQueues; ++ QList mActiveWindows; + struct wl_callback *mSyncCallback = nullptr; + static const wl_callback_listener syncCallbackListener; +- QReadWriteLock m_frameQueueLock; + + bool mClientSideInputContextRequested = !QPlatformInputContextFactory::requested().isNull(); + +diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp +index 3a6fa651..3b876047 100644 +--- a/src/client/qwaylandintegration.cpp ++++ b/src/client/qwaylandintegration.cpp +@@ -192,9 +192,7 @@ QAbstractEventDispatcher *QWaylandIntegration::createEventDispatcher() const + + void QWaylandIntegration::initialize() + { +- int fd = wl_display_get_fd(mDisplay->wl_display()); +- QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data()); +- QObject::connect(sn, SIGNAL(activated(QSocketDescriptor)), mDisplay.data(), SLOT(flushRequests())); ++ mDisplay->initEventThread(); + + // Call after eventDispatcher is fully connected, for QWaylandDisplay::forceRoundTrip() + mDisplay->initialize(); +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 1597f67e..7de19a74 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) +- , mFrameQueue(mDisplay->createFrameQueue()) + , mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP")) + { + { +@@ -95,8 +94,6 @@ QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display) + + QWaylandWindow::~QWaylandWindow() + { +- mDisplay->destroyFrameQueue(mFrameQueue); +- + delete mWindowDecoration; + + if (mSurface) +@@ -635,6 +632,8 @@ const wl_callback_listener QWaylandWindow::callbackListener = { + + void QWaylandWindow::handleFrameCallback() + { ++ QMutexLocker locker(&mFrameSyncMutex); ++ + mWaitingForFrameCallback = false; + mFrameCallbackElapsedTimer.invalidate(); + +@@ -656,12 +655,16 @@ void QWaylandWindow::handleFrameCallback() + mWaitingForUpdateDelivery = true; + QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection); + } ++ ++ mFrameSyncWait.notify_all(); + } + + bool QWaylandWindow::waitForFrameSync(int timeout) + { +- QMutexLocker locker(mFrameQueue.mutex); +- mDisplay->dispatchQueueWhile(mFrameQueue.queue, [&]() { return mWaitingForFrameCallback; }, timeout); ++ QMutexLocker locker(&mFrameSyncMutex); ++ ++ QDeadlineTimer deadline(timeout); ++ while (mWaitingForFrameCallback && mFrameSyncWait.wait(&mFrameSyncMutex, deadline)) { } + + if (mWaitingForFrameCallback) { + qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed"; +@@ -1157,8 +1160,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 +- if (mWaitingForFrameCallback) +- return; ++ { ++ QMutexLocker locker(&mFrameSyncMutex); ++ if (mWaitingForFrameCallback) ++ return; ++ } + + // 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 +@@ -1171,7 +1177,12 @@ void QWaylandWindow::requestUpdate() + // so use invokeMethod to delay the delivery a bit. + QMetaObject::invokeMethod(this, [this] { + // Things might have changed in the meantime +- if (hasPendingUpdateRequest() && !mWaitingForFrameCallback) ++ { ++ QMutexLocker locker(&mFrameSyncMutex); ++ if (mWaitingForFrameCallback) ++ return; ++ } ++ if (hasPendingUpdateRequest()) + deliverUpdateRequest(); + }, Qt::QueuedConnection); + } +@@ -1191,9 +1202,10 @@ void QWaylandWindow::handleUpdate() + if (!mSurface) + return; + +- QMutexLocker locker(mFrameQueue.mutex); ++ QMutexLocker locker(&mFrameSyncMutex); ++ + struct ::wl_surface *wrappedSurface = reinterpret_cast(wl_proxy_create_wrapper(mSurface->object())); +- wl_proxy_set_queue(reinterpret_cast(wrappedSurface), mFrameQueue.queue); ++ wl_proxy_set_queue(reinterpret_cast(wrappedSurface), mDisplay->frameEventQueue()); + mFrameCallback = wl_surface_frame(wrappedSurface); + wl_proxy_wrapper_destroy(wrappedSurface); + wl_callback_add_listener(mFrameCallback, &QWaylandWindow::callbackListener, this); +@@ -1203,6 +1215,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] { ++ QMutexLocker locker(&mFrameSyncMutex); ++ + if (mWaitingForFrameCallback) { + if (mFrameCallbackCheckIntervalTimerId < 0) + mFrameCallbackCheckIntervalTimerId = startTimer(mFrameCallbackTimeout); +diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h +index e0687962..d45980a8 100644 +--- a/src/client/qwaylandwindow_p.h ++++ b/src/client/qwaylandwindow_p.h +@@ -232,7 +232,7 @@ protected: + int mFrameCallbackCheckIntervalTimerId = -1; + QElapsedTimer mFrameCallbackElapsedTimer; + struct ::wl_callback *mFrameCallback = nullptr; +- QWaylandDisplay::FrameQueue mFrameQueue; ++ QMutex mFrameSyncMutex; + QWaitCondition mFrameSyncWait; + + // True when we have called deliverRequestUpdate, but the client has not yet attached a new buffer +-- +2.35.1 + diff --git a/SOURCES/0031-Check-pointer-for-null-before-use-in-ASSERT.patch b/SOURCES/0031-Check-pointer-for-null-before-use-in-ASSERT.patch new file mode 100644 index 0000000..062cab9 --- /dev/null +++ b/SOURCES/0031-Check-pointer-for-null-before-use-in-ASSERT.patch @@ -0,0 +1,30 @@ +From ca1d9023b6d40a128faad652f02881b5805e36ba Mon Sep 17 00:00:00 2001 +From: Roman Genkhel +Date: Thu, 12 Nov 2020 12:21:51 +0300 +Subject: [PATCH 31/40] Check pointer for null before use in ASSERT + +Task-number: QTBUG-85195 +Change-Id: I331e54f6e58aa9d536351a55223610c60b3cb414 +Reviewed-by: David Edmundson +(cherry picked from commit e235e8ddb1fc3cc5ab3b70b1fb285770b2c8c9ca) +--- + src/client/qwaylandwindow.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 7de19a74..ac01dc05 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -552,8 +552,8 @@ void QWaylandWindow::sendRecursiveExposeEvent() + + void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y) + { +- Q_ASSERT(!buffer->committed()); + if (buffer) { ++ Q_ASSERT(!buffer->committed()); + handleUpdate(); + buffer->setBusy(); + +-- +2.35.1 + diff --git a/SOURCES/0032-Do-not-create-decorations-when-the-shellSurface-is-n.patch b/SOURCES/0032-Do-not-create-decorations-when-the-shellSurface-is-n.patch new file mode 100644 index 0000000..80acb5d --- /dev/null +++ b/SOURCES/0032-Do-not-create-decorations-when-the-shellSurface-is-n.patch @@ -0,0 +1,39 @@ +From e6b30f42f8eec2ecc10395593dbfff354acd5425 Mon Sep 17 00:00:00 2001 +From: Inho Lee +Date: Mon, 1 Nov 2021 14:23:58 +0100 +Subject: [PATCH 32/40] Do not create decorations when the shellSurface is not + ready + +A cases reported that client windows try to make decorations +when their shell surfaces are null. +Since the surfaces' requests for decorations should be applied, +those case will be failed to create decorations. + +This patch was modified by Paul Tvete's advice. +(paul.tvete@qt.io) + +Pick-to: 6.2 5.15 +Task-number: QTBUG-97608 +Change-Id: I2563dbd73b730f81cc411857af07da99ceb2d063 +Reviewed-by: Paul Olav Tvete +(cherry picked from commit 246f0c0bc01dd059bf8165e81f7b49efa36e4d95) +--- + src/client/qwaylandwindow.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index ac01dc05..acfe390e 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -813,7 +813,7 @@ bool QWaylandWindow::createDecoration() + decoration = false; + if (mSubSurfaceWindow) + decoration = false; +- if (mShellSurface && !mShellSurface->wantsDecorations()) ++ if (!mShellSurface || !mShellSurface->wantsDecorations()) + decoration = false; + + bool hadDecoration = mWindowDecoration; +-- +2.35.1 + diff --git a/SOURCES/0033-Use-wl_surface.damage_buffer-on-the-client-side.patch b/SOURCES/0033-Use-wl_surface.damage_buffer-on-the-client-side.patch new file mode 100644 index 0000000..145ec94 --- /dev/null +++ b/SOURCES/0033-Use-wl_surface.damage_buffer-on-the-client-side.patch @@ -0,0 +1,131 @@ +From 3027c9659866101c06252829d99e7597cef19a40 Mon Sep 17 00:00:00 2001 +From: Paul Olav Tvete +Date: Mon, 6 Jul 2020 14:37:35 +0200 +Subject: [PATCH 33/40] Use wl_surface.damage_buffer on the client side + +Prefer the newer, recommended damage_buffer when the compositor +supports it. + +Fixes: QTBUG-74929 +Change-Id: I9107966910b616a666931404a7b41bfac14c22c0 +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit 314fd6db51277224cdc799b039ef79db1101f5cd) +--- + src/client/qwaylanddisplay.cpp | 2 +- + src/client/qwaylandwindow.cpp | 16 +++++++++++++--- + tests/auto/client/shared/coreprotocol.h | 2 +- + tests/auto/client/shared_old/mockcompositor.cpp | 2 +- + tests/auto/client/shared_old/mocksurface.cpp | 10 ++++++++++ + tests/auto/client/shared_old/mocksurface.h | 2 ++ + 6 files changed, 28 insertions(+), 6 deletions(-) + +diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp +index a7ce280a..6f1bada5 100644 +--- a/src/client/qwaylanddisplay.cpp ++++ b/src/client/qwaylanddisplay.cpp +@@ -488,7 +488,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin + if (interface == QStringLiteral("wl_output")) { + mWaitingScreens << new QWaylandScreen(this, version, id); + } else if (interface == QStringLiteral("wl_compositor")) { +- mCompositorVersion = qMin((int)version, 3); ++ mCompositorVersion = qMin((int)version, 4); + mCompositor.init(registry, id, mCompositorVersion); + } 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 acfe390e..4c5711a0 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -571,7 +571,11 @@ void QWaylandWindow::attachOffset(QWaylandBuffer *buffer) + + void QWaylandWindow::damage(const QRect &rect) + { +- mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); ++ const int s = scale(); ++ if (mDisplay->compositorVersion() >= 4) ++ mSurface->damage_buffer(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height()); ++ else ++ mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); + } + + void QWaylandWindow::safeCommit(QWaylandBuffer *buffer, const QRegion &damage) +@@ -605,8 +609,14 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage) + return; + + attachOffset(buffer); +- for (const QRect &rect: damage) +- mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); ++ if (mDisplay->compositorVersion() >= 4) { ++ const int s = scale(); ++ for (const QRect &rect: damage) ++ mSurface->damage_buffer(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height()); ++ } else { ++ for (const QRect &rect: damage) ++ mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); ++ } + Q_ASSERT(!buffer->committed()); + buffer->setCommitted(); + mSurface->commit(); +diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h +index a1af137a..296dbf47 100644 +--- a/tests/auto/client/shared/coreprotocol.h ++++ b/tests/auto/client/shared/coreprotocol.h +@@ -158,7 +158,7 @@ class WlCompositor : public Global, public QtWaylandServer::wl_compositor + { + Q_OBJECT + public: +- explicit WlCompositor(CoreCompositor *compositor, int version = 3) ++ explicit WlCompositor(CoreCompositor *compositor, int version = 4) + : QtWaylandServer::wl_compositor(compositor->m_display, version) + , m_compositor(compositor) + {} +diff --git a/tests/auto/client/shared_old/mockcompositor.cpp b/tests/auto/client/shared_old/mockcompositor.cpp +index a415cbf5..b1d3d07d 100644 +--- a/tests/auto/client/shared_old/mockcompositor.cpp ++++ b/tests/auto/client/shared_old/mockcompositor.cpp +@@ -342,7 +342,7 @@ Compositor::Compositor(MockCompositor *mockCompositor) + exit(EXIT_FAILURE); + } + +- wl_global_create(m_display, &wl_compositor_interface, 1, this, bindCompositor); ++ wl_global_create(m_display, &wl_compositor_interface, 4, this, bindCompositor); + + m_data_device_manager.reset(new DataDeviceManager(this, m_display)); + +diff --git a/tests/auto/client/shared_old/mocksurface.cpp b/tests/auto/client/shared_old/mocksurface.cpp +index e9df5f90..c3246e4a 100644 +--- a/tests/auto/client/shared_old/mocksurface.cpp ++++ b/tests/auto/client/shared_old/mocksurface.cpp +@@ -125,6 +125,16 @@ void Surface::surface_damage(Resource *resource, + Q_UNUSED(height); + } + ++void Surface::surface_damage_buffer(Resource *resource, ++ int32_t x, int32_t y, int32_t width, int32_t height) ++{ ++ Q_UNUSED(resource); ++ Q_UNUSED(x); ++ Q_UNUSED(y); ++ Q_UNUSED(width); ++ Q_UNUSED(height); ++} ++ + void Surface::surface_frame(Resource *resource, + uint32_t callback) + { +diff --git a/tests/auto/client/shared_old/mocksurface.h b/tests/auto/client/shared_old/mocksurface.h +index 949dc23d..d176837e 100644 +--- a/tests/auto/client/shared_old/mocksurface.h ++++ b/tests/auto/client/shared_old/mocksurface.h +@@ -65,6 +65,8 @@ protected: + struct wl_resource *buffer, int x, int y) override; + void surface_damage(Resource *resource, + int32_t x, int32_t y, int32_t width, int32_t height) override; ++ void surface_damage_buffer(Resource *resource, ++ int32_t x, int32_t y, int32_t width, int32_t height) override; + void surface_frame(Resource *resource, + uint32_t callback) override; + void surface_commit(Resource *resource) override; +-- +2.35.1 + diff --git a/SOURCES/0034-Fix-crash-if-no-input-method-module-could-be-loaded.patch b/SOURCES/0034-Fix-crash-if-no-input-method-module-could-be-loaded.patch new file mode 100644 index 0000000..00f389c --- /dev/null +++ b/SOURCES/0034-Fix-crash-if-no-input-method-module-could-be-loaded.patch @@ -0,0 +1,29 @@ +From 297c4e075068bffe4a396b2553afc4798c97fb4c Mon Sep 17 00:00:00 2001 +From: Joni Poikelin +Date: Thu, 3 Feb 2022 14:01:50 +0200 +Subject: [PATCH 34/40] Fix crash if no input method module could be loaded + +Pick-to: 6.2 6.3 5.15 +Change-Id: I8f346def616606a6c5540856bd08a84ee7ed5ca2 +Reviewed-by: David Edmundson +(cherry picked from commit 49fb7248f6ab7de046e2179c7861951ea1169e9b) +--- + src/client/qwaylandintegration.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp +index 3b876047..fbf00c6b 100644 +--- a/src/client/qwaylandintegration.cpp ++++ b/src/client/qwaylandintegration.cpp +@@ -491,7 +491,7 @@ void QWaylandIntegration::reconfigureInputContext() + } + #endif + +- qCDebug(lcQpaWayland) << "using input method:" << inputContext()->metaObject()->className(); ++ qCDebug(lcQpaWayland) << "using input method:" << (inputContext() ? inputContext()->metaObject()->className() : ""); + } + + QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &integrationName) +-- +2.35.1 + diff --git a/SOURCES/0035-Client-Remove-mWaitingForUpdateDelivery.patch b/SOURCES/0035-Client-Remove-mWaitingForUpdateDelivery.patch new file mode 100644 index 0000000..7e3e1df --- /dev/null +++ b/SOURCES/0035-Client-Remove-mWaitingForUpdateDelivery.patch @@ -0,0 +1,79 @@ +From a97759d032a40045551546ca17300891d4067ee4 Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Tue, 1 Feb 2022 13:05:36 +0200 +Subject: [PATCH 35/40] Client: Remove mWaitingForUpdateDelivery + +Currently, mWaitingForUpdateDelivery is shared between the main thread +(doHandleFrameCallback()) and the frame callback event thread +(handleFrameCallback()), however the access to it is not synchronized +between both threads. On the other hand, QWaylandWindow +already ensures not to create a frame callback if there's already one +pending. + +This change removes mWaitingForUpdateDelivery flag because it should be +already covered by mWaitingForFrameCallback and to remove unsynchronized +shared state between threads. + +Change-Id: I0e5a25d18d1e66c4d7683e7e972330c4d7cbbf38 +Reviewed-by: David Edmundson +(cherry picked from commit feb1a5c207c13d0bf87c0d8ad039279dbf8cee9e) +--- + src/client/qwaylandwindow.cpp | 29 ++++++++++++----------------- + src/client/qwaylandwindow_p.h | 1 - + 2 files changed, 12 insertions(+), 18 deletions(-) + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 4c5711a0..949374b1 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -648,23 +648,18 @@ void QWaylandWindow::handleFrameCallback() + mFrameCallbackElapsedTimer.invalidate(); + + // The rest can wait until we can run it on the correct thread +- if (!mWaitingForUpdateDelivery) { +- auto doHandleExpose = [this]() { +- bool wasExposed = isExposed(); +- mFrameCallbackTimedOut = false; +- if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed? +- sendExposeEvent(QRect(QPoint(), geometry().size())); +- if (wasExposed && hasPendingUpdateRequest()) +- deliverUpdateRequest(); +- +- mWaitingForUpdateDelivery = false; +- }; +- +- // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync() +- // in the single-threaded case. +- mWaitingForUpdateDelivery = true; +- QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection); +- } ++ auto doHandleExpose = [this]() { ++ bool wasExposed = isExposed(); ++ mFrameCallbackTimedOut = false; ++ if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed? ++ sendExposeEvent(QRect(QPoint(), geometry().size())); ++ if (wasExposed && hasPendingUpdateRequest()) ++ deliverUpdateRequest(); ++ }; ++ ++ // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync() ++ // in the single-threaded case. ++ QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection); + + mFrameSyncWait.notify_all(); + } +diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h +index d45980a8..3ff68ccb 100644 +--- a/src/client/qwaylandwindow_p.h ++++ b/src/client/qwaylandwindow_p.h +@@ -228,7 +228,6 @@ protected: + WId mWindowId; + bool mWaitingForFrameCallback = false; + bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out +- bool mWaitingForUpdateDelivery = false; + int mFrameCallbackCheckIntervalTimerId = -1; + QElapsedTimer mFrameCallbackElapsedTimer; + struct ::wl_callback *mFrameCallback = nullptr; +-- +2.35.1 + diff --git a/SOURCES/0036-Cursor-position-0-should-still-show-the-cursor.patch b/SOURCES/0036-Cursor-position-0-should-still-show-the-cursor.patch new file mode 100644 index 0000000..61a0d54 --- /dev/null +++ b/SOURCES/0036-Cursor-position-0-should-still-show-the-cursor.patch @@ -0,0 +1,35 @@ +From d3b794920d643fc5d722f63ad52b91e8143c0de0 Mon Sep 17 00:00:00 2001 +From: Weng Xuetian +Date: Tue, 8 Feb 2022 07:11:25 -0800 +Subject: [PATCH 36/40] Cursor position == 0 should still show the cursor + +Otherwise the cursor would be hidden even if preedit is empty. +Amends 719a55be13bdadfa659a732755f280e276a894bd + +Pick-to: 5.15 6.2 6.3 +Change-Id: I320733b917779b7b51aa4a28eaea411fdb10a318 +Reviewed-by: Liang Qi +(cherry picked from commit 31ae194e295651d9ece03408630d2358acd4f7b4) +--- + src/shared/qwaylandinputmethodeventbuilder.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp +index 25be2509..458d818e 100644 +--- a/src/shared/qwaylandinputmethodeventbuilder.cpp ++++ b/src/shared/qwaylandinputmethodeventbuilder.cpp +@@ -151,9 +151,9 @@ QInputMethodEvent QWaylandInputMethodEventBuilder::buildPreedit(const QString &t + { + QList attributes; + +- if (m_preeditCursor <= 0) { ++ if (m_preeditCursor < 0) { + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, 0, 0, QVariant())); +- } else if (m_preeditCursor > 0) { ++ } else { + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, indexFromWayland(text, m_preeditCursor), 1, QVariant())); + } + +-- +2.35.1 + diff --git a/SOURCES/0037-Fix-backport-context-destruction-was-omitted.patch b/SOURCES/0037-Fix-backport-context-destruction-was-omitted.patch deleted file mode 100644 index 6fd052d..0000000 --- a/SOURCES/0037-Fix-backport-context-destruction-was-omitted.patch +++ /dev/null @@ -1,29 +0,0 @@ -From eb422ab5e07498a7a8d086f6a942ee35ab3c9776 Mon Sep 17 00:00:00 2001 -From: Aleix Pol -Date: Thu, 9 Dec 2021 17:35:24 +0100 -Subject: [PATCH 37/41] Fix backport, context destruction was omitted - -When cherry-picking for 9df11e79b46c77d8c83f765b2a8e85b639fd55a2, this -line got removed when rebasing the patch, which created a leak. - -BUG: 442844 -Change-Id: Id00e8b194dcd910c5f01ce9d2cc318f96a4129a2 ---- - src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -index 95d1049c..683fe123 100644 ---- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp -@@ -407,6 +407,7 @@ QWaylandGLContext::~QWaylandGLContext() - { - delete m_blitter; - m_blitter = nullptr; -+ eglDestroyContext(m_eglDisplay, m_context); - if (m_decorationsContext != EGL_NO_CONTEXT) - eglDestroyContext(m_eglDisplay, m_decorationsContext); - } --- -2.34.1 - diff --git a/SOURCES/0037-Update-the-preedit-styling-mapping.patch b/SOURCES/0037-Update-the-preedit-styling-mapping.patch new file mode 100644 index 0000000..b99a32e --- /dev/null +++ b/SOURCES/0037-Update-the-preedit-styling-mapping.patch @@ -0,0 +1,88 @@ +From 3ddd4dcb1790920ce2598ebdbe14c95bdba55005 Mon Sep 17 00:00:00 2001 +From: Weng Xuetian +Date: Wed, 22 Dec 2021 10:42:38 -0800 +Subject: [PATCH 37/40] Update the preedit styling mapping + +- None mapping to no style. +- Default/Underline mapping to underline. +- Highlight/Selection mapping to background color/text color with highlight/highlight +text with underline. +- Active/Inactive mapping to bold text with underline. +- Incorrect mapping to red wave underline. + +Pick-to: 5.15 6.2 6.3 +Change-Id: Iab51d671b8f83aece8596f7f7610de19343fcceb +Reviewed-by: Aleix Pol Gonzalez +(cherry picked from commit f1fb5d9e568a24e213ee41e82a1142cef56f1098) +--- + .../qwaylandinputmethodeventbuilder.cpp | 31 ++++++++++++------- + 1 file changed, 20 insertions(+), 11 deletions(-) + +diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp +index 458d818e..f50ccf30 100644 +--- a/src/shared/qwaylandinputmethodeventbuilder.cpp ++++ b/src/shared/qwaylandinputmethodeventbuilder.cpp +@@ -39,7 +39,10 @@ + + #include "qwaylandinputmethodeventbuilder_p.h" + ++#include ++#include + #include ++#include + #include + + #ifdef QT_BUILD_WAYLANDCOMPOSITOR_LIB +@@ -81,32 +84,38 @@ void QWaylandInputMethodEventBuilder::addPreeditStyling(uint32_t index, uint32_t + QTextCharFormat format; + + switch (style) { +- case 0: +- case 1: ++ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_NONE: ++ break; ++ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_DEFAULT: ++ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_UNDERLINE: + format.setFontUnderline(true); + format.setUnderlineStyle(QTextCharFormat::SingleUnderline); + m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format)); + break; +- case 2: +- case 3: ++ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ACTIVE: ++ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_INACTIVE: + format.setFontWeight(QFont::Bold); + format.setFontUnderline(true); + format.setUnderlineStyle(QTextCharFormat::SingleUnderline); + m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format)); + break; +- case 4: +- format.setFontUnderline(true); +- format.setUnderlineStyle(QTextCharFormat::SingleUnderline); +- m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format)); ++ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_HIGHLIGHT: ++ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_SELECTION: ++ { ++ format.setFontUnderline(true); ++ format.setUnderlineStyle(QTextCharFormat::SingleUnderline); ++ QPalette palette = qApp->palette(); ++ format.setBackground(QBrush(palette.color(QPalette::Active, QPalette::Highlight))); ++ format.setForeground(QBrush(palette.color(QPalette::Active, QPalette::HighlightedText))); ++ m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format)); ++ } + break; +- case 5: ++ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_INCORRECT: + format.setFontUnderline(true); + format.setUnderlineStyle(QTextCharFormat::WaveUnderline); + format.setUnderlineColor(QColor(Qt::red)); + m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format)); + break; +-// case QtWayland::wl_text_input::preedit_style_selection: +-// case QtWayland::wl_text_input::preedit_style_none: + default: + break; + } +-- +2.35.1 + diff --git a/SOURCES/0038-client-Simplify-round-trip-behavior.patch b/SOURCES/0038-client-Simplify-round-trip-behavior.patch new file mode 100644 index 0000000..de16fc0 --- /dev/null +++ b/SOURCES/0038-client-Simplify-round-trip-behavior.patch @@ -0,0 +1,82 @@ +From 971dbf2d5be743ddeb998f7461ff3e06ccb892c4 Mon Sep 17 00:00:00 2001 +From: David Edmundson +Date: Wed, 9 Feb 2022 17:20:48 +0000 +Subject: [PATCH 38/40] client: Simplify round trip behavior + +The custom event queue was removed in +302d4ffb8549214eb4028dc3e47ec4ee4e12ffbd (2015) so the comment about not +being able to use the inbuilt round trip method no longer applies. + +This fixes a real world problem. Use of a blocking round trip should not +process non wayland events. Doing so can lead to misbehaviour client +side as things happen out of order. The move to the event thread created +several regressions as we now get events before the QGuiApplication is +fully constructed. + +Change-Id: I650481f49a47ed1a9778c7e1bc3c48db6e8f0031 +Reviewed-by: Vlad Zahorodnii +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit 62646d9122845d7bd9104b610478cebde3e769c7) +--- + src/client/qwaylanddisplay.cpp | 43 +--------------------------------- + 1 file changed, 1 insertion(+), 42 deletions(-) + +diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp +index 6f1bada5..86045a35 100644 +--- a/src/client/qwaylanddisplay.cpp ++++ b/src/client/qwaylanddisplay.cpp +@@ -611,50 +611,9 @@ uint32_t QWaylandDisplay::currentTimeMillisec() + return 0; + } + +-static void +-sync_callback(void *data, struct wl_callback *callback, uint32_t serial) +-{ +- Q_UNUSED(serial) +- bool *done = static_cast(data); +- +- *done = true; +- +- // If the wl_callback done event is received after the condition check in the while loop in +- // forceRoundTrip(), but before the call to processEvents, the call to processEvents may block +- // forever if no more events are posted (eventhough the callback is handled in response to the +- // aboutToBlock signal). Hence, we wake up the event dispatcher so forceRoundTrip may return. +- // (QTBUG-64696) +- if (auto *dispatcher = QThread::currentThread()->eventDispatcher()) +- dispatcher->wakeUp(); +- +- wl_callback_destroy(callback); +-} +- +-static const struct wl_callback_listener sync_listener = { +- sync_callback +-}; +- + void QWaylandDisplay::forceRoundTrip() + { +- // wl_display_roundtrip() works on the main queue only, +- // but we use a separate one, so basically reimplement it here +- int ret = 0; +- bool done = false; +- wl_callback *callback = wl_display_sync(mDisplay); +- wl_callback_add_listener(callback, &sync_listener, &done); +- flushRequests(); +- if (QThread::currentThread()->eventDispatcher()) { +- while (!done && ret >= 0) { +- QThread::currentThread()->eventDispatcher()->processEvents(QEventLoop::WaitForMoreEvents); +- ret = wl_display_dispatch_pending(mDisplay); +- } +- } else { +- while (!done && ret >= 0) +- ret = wl_display_dispatch(mDisplay); +- } +- +- if (ret == -1 && !done) +- wl_callback_destroy(callback); ++ wl_display_roundtrip(mDisplay); + } + + bool QWaylandDisplay::supportsWindowDecoration() const +-- +2.35.1 + diff --git a/SOURCES/0039-Client-Fix-opaque-region-setter.patch b/SOURCES/0039-Client-Fix-opaque-region-setter.patch new file mode 100644 index 0000000..8aa426a --- /dev/null +++ b/SOURCES/0039-Client-Fix-opaque-region-setter.patch @@ -0,0 +1,31 @@ +From 9930ed9942d2d26211195571673bea35261ad26b Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Sat, 19 Feb 2022 17:01:04 +0200 +Subject: [PATCH 39/40] 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. + +Change-Id: I75042b4d779dfd4dfe610aad1f0387879f11b048 +Reviewed-by: Aleix Pol Gonzalez +(cherry picked from commit f9425f573b18c0b66fd9ad9c2805e8b8b9a3ec77) +--- + src/client/qwaylandwindow.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 949374b1..fee2ecdd 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -372,7 +372,7 @@ void QWaylandWindow::setGeometry(const QRect &rect) + mShellSurface->setWindowGeometry(windowContentGeometry()); + + if (isOpaque() && mMask.isEmpty()) +- setOpaqueArea(rect); ++ setOpaqueArea(QRect(QPoint(0, 0), rect.size())); + } + + void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset) +-- +2.35.1 + diff --git a/SOURCES/0040-Use-proper-dependencies-in-compile-tests.patch b/SOURCES/0040-Use-proper-dependencies-in-compile-tests.patch new file mode 100644 index 0000000..80cc882 --- /dev/null +++ b/SOURCES/0040-Use-proper-dependencies-in-compile-tests.patch @@ -0,0 +1,126 @@ +From 118674630cdb5933e66a8b4415afe7c716ad4662 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Fri, 4 Feb 2022 11:07:36 +0100 +Subject: [PATCH 40/40] 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"). + +Additionally, VK_USE_PLATFORM_WAYLAND_KHR requires , so +add the wayland-client dependency. + +This fixes those tests if e.g. wayland-client headers need to be found through +pkgconfig. + +This part of the code changed completely in Qt 6, so this is a totally +different patch and not a cherry-pick of 5fc2e1915c3a +("CMake: Fix qtwayland feature detection"). + +Fixes: QTBUG-100475 +--- + src/client/configure.json | 8 ++++---- + src/compositor/configure.json | 34 +++++++++++++++++++++++++++++----- + 2 files changed, 33 insertions(+), 9 deletions(-) + +diff --git a/src/client/configure.json b/src/client/configure.json +index 2f424580..29222357 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 @@ + "exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;", + "return 0;" + ] +- } ++ }, ++ "use": "wayland-client" + }, + "egl_1_5-wayland": { + "label": "EGL 1.5 with Wayland Platform", +@@ -183,7 +183,7 @@ + "eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, (struct wl_display *)(nullptr), nullptr);" + ] + }, +- "use": "egl" ++ "use": "egl wayland-client" + } + }, + +diff --git a/src/compositor/configure.json b/src/compositor/configure.json +index bcfd5215..da95d07b 100644 +--- a/src/compositor/configure.json ++++ b/src/compositor/configure.json +@@ -7,6 +7,31 @@ + "testDir": "../../config.tests", + + "libraries": { ++ "wayland-client": { ++ "label": "Wayland client library", ++ "headers": "wayland-version.h", ++ "test": { ++ "main": [ ++ "#if WAYLAND_VERSION_MAJOR < 1", ++ "# error Wayland 1.8.0 or higher required", ++ "#endif", ++ "#if WAYLAND_VERSION_MAJOR == 1", ++ "# if WAYLAND_VERSION_MINOR < 8", ++ "# error Wayland 1.8.0 or higher required", ++ "# endif", ++ "# if WAYLAND_VERSION_MINOR == 8", ++ "# if WAYLAND_VERSION_MICRO < 0", ++ "# error Wayland 1.8.0 or higher required", ++ "# endif", ++ "# endif", ++ "#endif" ++ ] ++ }, ++ "sources": [ ++ { "type": "pkgConfig", "args": "wayland-client" }, ++ "-lwayland-client" ++ ] ++ }, + "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 @@ + "exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;", + "return 0;" + ] +- } ++ }, ++ "use": "wayland-client" + } + }, + +-- +2.35.1 + diff --git a/SOURCES/0041-Client-set-constraint-adjustments-for-popups-in-xdg.patch b/SOURCES/0041-Client-set-constraint-adjustments-for-popups-in-xdg.patch new file mode 100644 index 0000000..4320d76 --- /dev/null +++ b/SOURCES/0041-Client-set-constraint-adjustments-for-popups-in-xdg.patch @@ -0,0 +1,33 @@ +From 48b9dbb4d9d508895f7568531d8f0a7e63261b75 Mon Sep 17 00:00:00 2001 +From: Liang Qi +Date: Tue, 4 Jan 2022 12:30:36 +0100 +Subject: [PATCH] client: set_constraint_adjustment() for popups in xdg + +See also https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/xdg-shell/xdg-shell.xml#n234 . + +Kudos to Greg V for his original patch in jira. + +Fixes: QTBUG-87303 +Pick-to: 5.15 6.2 6.3 +Done-with: Greg V +Change-Id: I57df9aedea7cc6f0b6fa142a6fc6c3bdc98324c8 +Reviewed-by: David Edmundson +(cherry picked from commit 59a5fe99e1569421b920d99c5b20cdafcdcf43a9) +diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +index 1c76294..3b99c4b 100644 +--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp ++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +@@ -410,6 +410,13 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) + positioner->set_anchor(QtWayland::xdg_positioner::anchor_top_left); + positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right); + positioner->set_size(m_window->geometry().width(), m_window->geometry().height()); ++ const QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP"); ++ if (currentDesktop != QByteArray("KDE")) { ++ 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); ++ } + m_popup = new Popup(this, parentXdgSurface, positioner); + positioner->destroy(); + delete positioner; diff --git a/SOURCES/qtwayland-client-expose-toplevel-window-state.patch b/SOURCES/qtwayland-client-expose-toplevel-window-state.patch new file mode 100644 index 0000000..7823473 --- /dev/null +++ b/SOURCES/qtwayland-client-expose-toplevel-window-state.patch @@ -0,0 +1,166 @@ +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/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index ba881cb..a1e891d 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -1089,6 +1089,16 @@ Qt::WindowStates QWaylandWindow::windowStates() const + return mLastReportedWindowStates; + } + ++QWaylandWindow::ToplevelWindowTilingStates QWaylandWindow::toplevelWindowTilingStates() const ++{ ++ return mLastReportedToplevelWindowTilingStates; ++} ++ ++void QWaylandWindow::handleToplevelWindowTilingStatesChanged(ToplevelWindowTilingStates states) ++{ ++ mLastReportedToplevelWindowTilingStates = states; ++} ++ + void QWaylandWindow::handleWindowStatesChanged(Qt::WindowStates states) + { + createDecoration(); +diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h +index e068796..f4e5d3d 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, ++ WindowTiledRight = 2, ++ WindowTiledTop = 4, ++ WindowTiledBottom = 8 ++ }; ++ Q_DECLARE_FLAGS(ToplevelWindowTilingStates, ToplevelWindowTilingState) ++ + QWaylandWindow(QWindow *window, QWaylandDisplay *display); + ~QWaylandWindow() override; + +@@ -145,6 +154,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: + QRegion mMask; + QRegion mOpaqueArea; + Qt::WindowStates mLastReportedWindowStates = Qt::WindowNoState; ++ ToplevelWindowTilingStates mLastReportedToplevelWindowTilingStates = WindowNoState; + + QWaylandShmBackingStore *mBackingStore = nullptr; + QWaylandBuffer *mQueuedBuffer = nullptr; +@@ -293,6 +306,8 @@ private: + friend class QWaylandSubSurface; + }; + ++Q_DECLARE_OPERATORS_FOR_FLAGS(QWaylandWindow::ToplevelWindowTilingStates) ++ + inline QIcon QWaylandWindow::windowIcon() const + { + return mWindowIcon; +diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +index d7d0ddf..2c6e84b 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 + case XDG_TOPLEVEL_STATE_FULLSCREEN: + m_pending.states |= Qt::WindowFullScreen; + break; ++ case XDG_TOPLEVEL_STATE_TILED_LEFT: ++ m_toplevelStates |= QWaylandWindow::WindowTiledLeft; ++ break; ++ case XDG_TOPLEVEL_STATE_TILED_RIGHT: ++ m_toplevelStates |= QWaylandWindow::WindowTiledRight; ++ break; ++ case XDG_TOPLEVEL_STATE_TILED_TOP: ++ m_toplevelStates |= QWaylandWindow::WindowTiledTop; ++ break; ++ case XDG_TOPLEVEL_STATE_TILED_BOTTOM: ++ m_toplevelStates |= QWaylandWindow::WindowTiledBottom; ++ break; + default: + break; + } +@@ -451,7 +465,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)) + , m_display(display) + { + display->addRegistryListener(&QWaylandXdgShell::handleRegistryGlobal, this); +diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +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/SPECS/qt5-qtwayland.spec b/SPECS/qt5-qtwayland.spec index 249539d..4cb13c4 100644 --- a/SPECS/qt5-qtwayland.spec +++ b/SPECS/qt5-qtwayland.spec @@ -4,60 +4,63 @@ Summary: Qt5 - Wayland platform support and QtCompositor module Name: qt5-%{qt_module} -Version: 5.15.2 -Release: 3%{?dist} +Version: 5.15.3 +Release: 1%{?dist} License: LGPLv3 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-src-%{version}.tar.xz +Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submodules/%{qt_module}-everywhere-opensource-src-%{version}.tar.xz ## Upstream patches ## repo: https://invent.kde.org/qt/qt/qtwayland ## branch: kde/5.15 -## git format-patch v5.15.2 -## These are already included in stock 5.15.2 tarball, referenced here for completeness -#Patch1: 0001-Bump-version.patch -#Patch2: 0002-Replace-remaining-LGPLv3-headers-in-QtWaylandComposi.patch -#Patch3: 0003-Doc-List-correct-license-information-for-the-module.patch -#Patch4: 0004-Add-changes-file-for-Qt-5.15.2.patch -Patch5: 0005-Scanner-Avoid-accessing-dangling-pointers-in-destroy.patch -Patch6: 0006-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch -Patch7: 0007-Do-not-try-to-eglMakeCurrent-for-unintended-case.patch -Patch8: 0008-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch -Patch9: 0009-Ensure-that-grabbing-is-performed-in-correct-context.patch -Patch10: 0010-Fix-leaked-subsurface-wayland-items.patch -Patch11: 0011-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch -Patch12: 0012-Fix-memory-leak-in-QWaylandGLContext.patch -Patch13: 0013-Client-Send-set_window_geometry-only-once-configured.patch -Patch14: 0014-Translate-opaque-area-with-frame-margins.patch -Patch15: 0015-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch -Patch16: 0016-Get-correct-decoration-margins-region.patch -Patch17: 0017-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch -Patch18: 0018-Fix-compilation.patch -Patch19: 0019-client-Allow-QWaylandInputContext-to-accept-composed.patch -Patch20: 0020-Client-Announce-an-output-after-receiving-more-compl.patch -Patch21: 0021-Fix-issue-with-repeated-window-size-changes.patch -Patch22: 0022-Include-locale.h-for-setlocale-LC_CTYPE.patch -Patch23: 0023-Client-Connect-drags-being-accepted-to-updating-the-.patch -Patch24: 0024-Client-Disconnect-registry-listener-on-destruction.patch -Patch25: 0025-Client-Set-XdgShell-size-hints-before-the-first-comm.patch -Patch26: 0026-Fix-build.patch -Patch27: 0027-Fix-remove-listener.patch -Patch28: 0028-Hook-up-queryKeyboardModifers.patch -Patch29: 0029-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch -Patch30: 0030-Correctly-detect-if-image-format-is-supported-by-QIm.patch -Patch31: 0031-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch -Patch32: 0032-Client-Don-t-always-recreate-frame-callbacks.patch -Patch33: 0033-Client-Always-destroy-frame-callback-in-the-actual-c.patch -Patch34: 0034-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch -Patch35: 0035-Wayland-client-use-wl_keyboard-to-determine-active-s.patch -Patch36: 0036-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch -Patch37: 0037-Fix-backport-context-destruction-was-omitted.patch -Patch38: 0038-Set-preedit-cursor-when-cursor-equals-to-0.patch -Patch39: 0039-Client-Implement-DataDeviceV3.patch -Patch40: 0040-Client-Delay-deletion-of-QDrag-object-until-after-we.patch -Patch41: 0041-Client-Avoid-processing-of-events-when-showing-windo.patch +## git format-patch v5.15.3-lts-lgpl +Patch1: 0001-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch +Patch2: 0002-Translate-opaque-area-with-frame-margins.patch +Patch3: 0003-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch +Patch4: 0004-Get-correct-decoration-margins-region.patch +Patch5: 0005-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch +Patch6: 0006-client-Allow-QWaylandInputContext-to-accept-composed.patch +Patch7: 0007-Client-Announce-an-output-after-receiving-more-compl.patch +Patch8: 0008-Fix-issue-with-repeated-window-size-changes.patch +Patch9: 0009-Include-locale.h-for-setlocale-LC_CTYPE.patch +Patch10: 0010-Client-Connect-drags-being-accepted-to-updating-the-.patch +Patch11: 0011-Client-Disconnect-registry-listener-on-destruction.patch +Patch12: 0012-Client-Set-XdgShell-size-hints-before-the-first-comm.patch +Patch13: 0013-Fix-build.patch +Patch14: 0014-Fix-remove-listener.patch +Patch15: 0015-Hook-up-queryKeyboardModifers.patch +Patch16: 0016-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch +Patch17: 0017-Correctly-detect-if-image-format-is-supported-by-QIm.patch +Patch18: 0018-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch +Patch19: 0019-Client-Don-t-always-recreate-frame-callbacks.patch +Patch20: 0020-Client-Always-destroy-frame-callback-in-the-actual-c.patch +Patch21: 0021-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch +Patch22: 0022-Wayland-client-use-wl_keyboard-to-determine-active-s.patch +Patch23: 0023-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch +Patch24: 0024-Set-preedit-cursor-when-cursor-equals-to-0.patch +Patch25: 0025-Client-Implement-DataDeviceV3.patch +Patch26: 0026-Client-Delay-deletion-of-QDrag-object-until-after-we.patch +Patch27: 0027-Client-Avoid-processing-of-events-when-showing-windo.patch +Patch28: 0028-Handle-registry_global-out-of-constructor.patch +Patch29: 0029-Connect-flushRequest-after-forceRoundTrip.patch +Patch30: 0030-Move-the-wayland-socket-polling-to-a-separate-event-.patch +Patch31: 0031-Check-pointer-for-null-before-use-in-ASSERT.patch +Patch32: 0032-Do-not-create-decorations-when-the-shellSurface-is-n.patch +Patch33: 0033-Use-wl_surface.damage_buffer-on-the-client-side.patch +Patch34: 0034-Fix-crash-if-no-input-method-module-could-be-loaded.patch +Patch35: 0035-Client-Remove-mWaitingForUpdateDelivery.patch +Patch36: 0036-Cursor-position-0-should-still-show-the-cursor.patch +Patch37: 0037-Update-the-preedit-styling-mapping.patch +Patch38: 0038-client-Simplify-round-trip-behavior.patch +Patch39: 0039-Client-Fix-opaque-region-setter.patch +Patch40: 0040-Use-proper-dependencies-in-compile-tests.patch +Patch41: 0041-Client-set-constraint-adjustments-for-popups-in-xdg.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 # filter qml provides %global __provides_exclude_from ^%{_qt5_archdatadir}/qml/.*\\.so$ @@ -190,6 +193,10 @@ popd %endif %changelog +* Mon Mar 28 2022 Jan Grulich - 5.15.3-1 +- 5.15.3 + Resolves: bz#2061408 + * Tue Jan 18 2022 Jan Grulich - 5.15.2-3 - Pull in latest kde/5.15 branch fixes Resolves: bz#2021761