diff --git a/qt5-qtwayland.spec b/qt5-qtwayland.spec index 3b833c1..eade45e 100644 --- a/qt5-qtwayland.spec +++ b/qt5-qtwayland.spec @@ -3,7 +3,7 @@ Summary: Qt5 - Wayland platform support and QtCompositor module Name: qt5-%{qt_module} Version: 5.15.2 -Release: 4%{?dist} +Release: 5%{?dist} License: LGPLv3 Url: http://www.qt.io @@ -12,6 +12,12 @@ Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submod # Upstream patches Patch0: qtwayland-scanner-avoid-accessing-dangling-pointers-in-destroy-func.patch +Patch1: qtwayland-fix-issue-with-repeated-window-size-changes.patch +Patch2: qtwayland-get-correct-margins-decoration-region.patch +Patch3: qtwayland-send-exposeevent-to-parent-on-subsurface-position.patch +Patch4: qtwayland-send-set-window-geometry-only-once-configured.patch +Patch5: qtwayland-tell-compositor-screen-we-are-expecting-to-fill.patch +Patch6: qtwayland-translate-opaque-area-for-decorations.patch # Upstreamable patches @@ -122,6 +128,9 @@ popd %changelog +* Tue Apr 06 2021 Jan Grulich - 5.15.2-5 +- Backport changes from Qt 5.15.3 + * Wed Jan 27 2021 Fedora Release Engineering - 5.15.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/qtwayland-fix-issue-with-repeated-window-size-changes.patch b/qtwayland-fix-issue-with-repeated-window-size-changes.patch new file mode 100644 index 0000000..7e6dee7 --- /dev/null +++ b/qtwayland-fix-issue-with-repeated-window-size-changes.patch @@ -0,0 +1,54 @@ +From 14d066c61025e548227ccd8d655e80ffa31fa15e Mon Sep 17 00:00:00 2001 +From: Jaeyoon Jung +Date: Mon, 15 Feb 2021 08:31:06 +0900 +Subject: [PATCH] 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 +where repeated setGeometry calls between two sizes might not work as +expected. The problem occurs when wl_egl_window_get_attached_size does +not get the same size that was requested by the previous setGeometry +call. If the returned size happened to match the new size instead, +we would mistakenly skip the resize. + +Change-Id: Iafe4a91cc707f854b9099b6109b6be1423d7bd29 +Reviewed-by: Eskil Abrahamsen Blomfeldt +--- + .../client/wayland-egl/qwaylandeglwindow.cpp | 4 +++- + .../client/wayland-egl/qwaylandeglwindow.h | 1 + + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +index 1e8dc06f7..355aca864 100644 +--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp ++++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +@@ -131,14 +131,16 @@ void QWaylandEglWindow::updateSurface(bool create) + if (!disableResizeCheck) { + wl_egl_window_get_attached_size(m_waylandEglWindow, ¤t_width, ¤t_height); + } +- if (disableResizeCheck || (current_width != sizeWithMargins.width() || current_height != sizeWithMargins.height())) { ++ if (disableResizeCheck || (current_width != sizeWithMargins.width() || current_height != sizeWithMargins.height()) || m_requestedSize != sizeWithMargins) { + wl_egl_window_resize(m_waylandEglWindow, sizeWithMargins.width(), sizeWithMargins.height(), mOffset.x(), mOffset.y()); ++ m_requestedSize = sizeWithMargins; + mOffset = QPoint(); + + m_resize = true; + } + } else if (create && wlSurface()) { + m_waylandEglWindow = wl_egl_window_create(wlSurface(), sizeWithMargins.width(), sizeWithMargins.height()); ++ m_requestedSize = sizeWithMargins; + } + + if (!m_eglSurface && m_waylandEglWindow && create) { +diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +index 5b1f4d56f..0079dfef8 100644 +--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h ++++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +@@ -88,6 +88,7 @@ class QWaylandEglWindow : public QWaylandWindow + mutable QOpenGLFramebufferObject *m_contentFBO = nullptr; + + QSurfaceFormat m_format; ++ QSize m_requestedSize; + }; + + } diff --git a/qtwayland-get-correct-margins-decoration-region.patch b/qtwayland-get-correct-margins-decoration-region.patch new file mode 100644 index 0000000..1f87e2e --- /dev/null +++ b/qtwayland-get-correct-margins-decoration-region.patch @@ -0,0 +1,33 @@ +From 14cf9f0e45c7617d787eba8d81bf9fd1cd66754b Mon Sep 17 00:00:00 2001 +From: Jan Grulich +Date: Thu, 11 Feb 2021 15:12:32 +0100 +Subject: [PATCH] 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 +region we need to update. + +Pick-to: 5.15 +Change-Id: Id1b7f4cd2a7b894b82db09c5af2b2d1f1f43fa2a +--- + +diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp +index 87dd6ce..b6ee43c 100644 +--- a/src/client/qwaylandabstractdecoration.cpp ++++ b/src/client/qwaylandabstractdecoration.cpp +@@ -108,11 +108,11 @@ + static QRegion marginsRegion(const QSize &size, const QMargins &margins) + { + QRegion r; +- const int widthWithMargins = margins.left() + size.width() + margins.right(); +- r += QRect(0, 0, widthWithMargins, margins.top()); // top +- r += QRect(0, size.height()+margins.top(), widthWithMargins, margins.bottom()); //bottom ++ ++ r += QRect(0, 0, size.width(), margins.top()); // top ++ r += QRect(0, size.height()-margins.bottom(), size.width(), margins.bottom()); //bottom + r += QRect(0, margins.top(), margins.left(), size.height()); //left +- r += QRect(size.width()+margins.left(), margins.top(), margins.right(), size.height()); // right ++ r += QRect(size.width()-margins.left(), margins.top(), margins.right(), size.height()-margins.top()); // right + return r; + } + diff --git a/qtwayland-send-exposeevent-to-parent-on-subsurface-position.patch b/qtwayland-send-exposeevent-to-parent-on-subsurface-position.patch new file mode 100644 index 0000000..980e223 --- /dev/null +++ b/qtwayland-send-exposeevent-to-parent-on-subsurface-position.patch @@ -0,0 +1,94 @@ +From b36a345d727eab37ee4ec4c2dc4674d5971c81d8 Mon Sep 17 00:00:00 2001 +From: David Edmundson +Date: Mon, 14 Sep 2020 17:08:39 +0100 +Subject: [PATCH] Client: Send exposeEvent to parent on subsurface position + changes + +When a subsurface is moved, we need the parent window to commit to apply +that move. Ideally we want this in sync with any potential rendering on +the parent window. + +Currently the code calls requestUpdate() which acts more like a frame +callback; it will only do something if the main QWindow considers itself +dirty. + +We want to force a repaint, which is semantically more similar to an +ExposeEvent. + +Fixes: QTBUG-86177 +Pick-to: 5.15 +Change-Id: I30bdfa357beee860ce2b00a256eaea6d040dd55c +Reviewed-by: Eskil Abrahamsen Blomfeldt +--- + src/client/qwaylandwindow.cpp | 7 ++++- + tests/auto/client/surface/tst_surface.cpp | 33 +++++++++++++++++++---- + 2 files changed, 34 insertions(+), 6 deletions(-) + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 3e26384..3cf1326 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -339,7 +339,12 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect) + if (mSubSurfaceWindow) { + QMargins m = QPlatformWindow::parent()->frameMargins(); + mSubSurfaceWindow->set_position(rect.x() + m.left(), rect.y() + m.top()); +- mSubSurfaceWindow->parent()->window()->requestUpdate(); ++ ++ QWaylandWindow *parentWindow = mSubSurfaceWindow->parent(); ++ if (parentWindow && parentWindow->isExposed()) { ++ QRect parentExposeGeometry(QPoint(), parentWindow->geometry().size()); ++ parentWindow->sendExposeEvent(parentExposeGeometry); ++ } + } + } + +diff --git a/tests/auto/client/surface/tst_surface.cpp b/tests/auto/client/surface/tst_surface.cpp +index b8a65f1..95e4e60 100644 +--- a/tests/auto/client/surface/tst_surface.cpp ++++ b/tests/auto/client/surface/tst_surface.cpp +@@ -167,17 +167,40 @@ void tst_surface::negotiateShmFormat() + void tst_surface::createSubsurface() + { + QRasterWindow window; +- window.resize(64, 64); +- window.show(); +- QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); +- exec([=] { xdgToplevel()->sendCompleteConfigure(); }); +- QCOMPOSITOR_TRY_VERIFY(xdgSurface()->m_committedConfigureSerial); ++ window.setObjectName("main"); ++ window.resize(200, 200); + + QRasterWindow subWindow; ++ subWindow.setObjectName("subwindow"); + subWindow.setParent(&window); + subWindow.resize(64, 64); ++ ++ window.show(); + subWindow.show(); ++ + QCOMPOSITOR_TRY_VERIFY(subSurface()); ++ QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); ++ exec([=] { xdgToplevel()->sendCompleteConfigure(); }); ++ QCOMPOSITOR_TRY_VERIFY(xdgSurface()->m_committedConfigureSerial); ++ ++ const Surface *mainSurface = exec([=] {return surface(0);}); ++ const Surface *childSurface = exec([=] {return surface(1);}); ++ QSignalSpy mainSurfaceCommitSpy(mainSurface, &Surface::commit); ++ QSignalSpy childSurfaceCommitSpy(childSurface, &Surface::commit); ++ ++ // Move subsurface. The parent should redraw and commit ++ subWindow.setGeometry(100, 100, 64, 64); ++ // the toplevel should commit to indicate the subsurface moved ++ QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.count(), 1); ++ mainSurfaceCommitSpy.clear(); ++ childSurfaceCommitSpy.clear(); ++ ++ // Move and resize the subSurface. The parent should redraw and commit ++ // The child should also redraw ++ subWindow.setGeometry(50, 50, 80, 80); ++ QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.count(), 1); ++ QCOMPOSITOR_TRY_COMPARE(childSurfaceCommitSpy.count(), 1); ++ + } + + // Used to cause a crash in libwayland (QTBUG-79674) diff --git a/qtwayland-send-set-window-geometry-only-once-configured.patch b/qtwayland-send-set-window-geometry-only-once-configured.patch new file mode 100644 index 0000000..40d32be --- /dev/null +++ b/qtwayland-send-set-window-geometry-only-once-configured.patch @@ -0,0 +1,38 @@ +From 2555663c9f59b93f5fcc5d3ead233bee280e36f8 Mon Sep 17 00:00:00 2001 +From: David Edmundson +Date: Mon, 16 Nov 2020 14:57:36 +0000 +Subject: [PATCH] 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 3e26384..80e9ffc 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -362,7 +362,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()) diff --git a/qtwayland-tell-compositor-screen-we-are-expecting-to-fill.patch b/qtwayland-tell-compositor-screen-we-are-expecting-to-fill.patch new file mode 100644 index 0000000..5a6f1e2 --- /dev/null +++ b/qtwayland-tell-compositor-screen-we-are-expecting-to-fill.patch @@ -0,0 +1,38 @@ +From f915e53eaa596654ee1b9726a4767a1cba11336f Mon Sep 17 00:00:00 2001 +From: Aleix Pol +Date: Mon, 23 Nov 2020 20:07:02 +0100 +Subject: [PATCH] xdgshell: Tell the compositor the screen we're expecting to + fill + +The xdgshell protocol allows us to tell the output to fill. This makes +it possible to use fullscreen confidently on systems with multiple +screens knowing that our windows won't be overlapping one another by +calling setScreen accordingly before QWindow::showFullScreen. + +Pick-to: 6.1 6.0 5.15 +Change-Id: I757854c3698639472f3a25ef298ddcca031e1ed5 +Reviewed-by: David Edmundson +--- + .../shellintegration/xdg-shell/qwaylandxdgshell.cpp | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +index b7253de2b..af8bd9264 100644 +--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp ++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +@@ -178,9 +178,12 @@ void QWaylandXdgSurface::Toplevel::requestWindowStates(Qt::WindowStates states) + } + + if (changedStates & Qt::WindowFullScreen) { +- if (states & Qt::WindowFullScreen) +- set_fullscreen(nullptr); +- else ++ if (states & Qt::WindowFullScreen) { ++ auto screen = m_xdgSurface->window()->waylandScreen(); ++ if (screen) { ++ set_fullscreen(screen->output()); ++ } ++ } else + unset_fullscreen(); + } + diff --git a/qtwayland-translate-opaque-area-for-decorations.patch b/qtwayland-translate-opaque-area-for-decorations.patch new file mode 100644 index 0000000..b897b55 --- /dev/null +++ b/qtwayland-translate-opaque-area-for-decorations.patch @@ -0,0 +1,34 @@ +From 1e0862acdc2e6ccf77bf3a1436b877d3af5e5fe7 Mon Sep 17 00:00:00 2001 +From: Jan Grulich +Date: Wed, 10 Feb 2021 17:11:27 +0100 +Subject: [PATCH] Translate opaque area with frame margins + +The opaque area doesn't take window decorations into account, which may +result into possible graphical artefacts. + +Pick-to: 5.15 +Change-Id: I1606e8256e7e204dad927931eb1221b576e227fd +--- + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 04c2dbd..b29edfa 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -1242,12 +1242,14 @@ + + void QWaylandWindow::setOpaqueArea(const QRegion &opaqueArea) + { +- if (opaqueArea == mOpaqueArea || !mSurface) ++ const QRegion translatedOpaqueArea = opaqueArea.translated(frameMargins().left(), frameMargins().top()); ++ ++ if (translatedOpaqueArea == mOpaqueArea || !mSurface) + return; + +- mOpaqueArea = opaqueArea; ++ mOpaqueArea = translatedOpaqueArea; + +- struct ::wl_region *region = mDisplay->createRegion(opaqueArea); ++ struct ::wl_region *region = mDisplay->createRegion(translatedOpaqueArea); + mSurface->set_opaque_region(region); + wl_region_destroy(region); + }