From 93a93e9a3b53c1a73142a305ea1f8136846942ee Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 22 Dec 2021 14:08:05 +0000 Subject: gentoo resync : 22.12.2021 --- .../kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch | 63 ------------- ...remove-dpms-filter-when-outputs-are-added.patch | 30 +++++++ ...5.23.4-fix-memory-leak-caching-QSGTexture.patch | 50 +++++++++++ ...ripting-fix-KWinComponents-Workspace-type.patch | 34 +++++++ ...land-resize-to-last-requested-client-size.patch | 100 +++++++++++++++++++++ ...gshell-protect-from-invalid-frameGeometry.patch | 36 ++++++++ 6 files changed, 250 insertions(+), 63 deletions(-) delete mode 100644 kde-plasma/kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch create mode 100644 kde-plasma/kwin/files/kwin-5.23.4-drm-remove-dpms-filter-when-outputs-are-added.patch create mode 100644 kde-plasma/kwin/files/kwin-5.23.4-fix-memory-leak-caching-QSGTexture.patch create mode 100644 kde-plasma/kwin/files/kwin-5.23.4-scripting-fix-KWinComponents-Workspace-type.patch create mode 100644 kde-plasma/kwin/files/kwin-5.23.4-wayland-resize-to-last-requested-client-size.patch create mode 100644 kde-plasma/kwin/files/kwin-5.23.4-xdgshell-protect-from-invalid-frameGeometry.patch (limited to 'kde-plasma/kwin/files') diff --git a/kde-plasma/kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch b/kde-plasma/kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch deleted file mode 100644 index d185d5e41fe6..000000000000 --- a/kde-plasma/kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 839710201c389b7f4ed248cb3818e755a37ce977 Mon Sep 17 00:00:00 2001 -From: Vlad Zahorodnii -Date: Fri, 10 Sep 2021 13:36:04 +0300 -Subject: [PATCH] x11: Fix build with EGL_NO_PLATFORM_SPECIFIC_TYPES - -eglCreateWindowSurface() wants a Window (unsigned long), but with -EGL_NO_PLATFORM_SPECIFIC_TYPES, EGLNativeWindowType is defined as an -opaque pointer, i.e. void*. - -BUG: 440372 - -* asturm 2021-09-21: Merged with upstream commits: -38e24ecd6416a975db0989c21b70d6a4cc242f35 "Fix build with 32-bit" -e26ea6bf2313c021db7e5ca5454cd8b1e2e2037f "Fix build on 32bit platforms" - -* asturm 2021-10-04: Merged with upstream commit: -From df11acd46778e1e43183c2660bc9dcb1a8ad3282 Mon Sep 17 00:00:00 2001 -From: Vlad Zahorodnii -Date: Tue, 21 Sep 2021 17:34:59 +0300 -Subject: [PATCH] x11: Cast Window to EGLNativeWindowType using a C cast - -reinterpret_cast<>() will fail if the types we cast from and to have -mismatching sizes. - -Unfortunately, there are platforms that have Window and -EGLNativeWindowType of different size. This results in compilation -errors. - -In order to work around those problematic platforms, this change -replaces reinterpret_cast cast with a c style cast. ---- - src/plugins/platforms/x11/common/eglonxbackend.cpp | 16 +++++++++------ - 1 file changed, 10 insertions(+), 6 deletions(-) - -diff -u a/src/plugins/platforms/x11/common/eglonxbackend.cpp b/src/plugins/platforms/x11/common/eglonxbackend.cpp ---- a/src/plugins/platforms/x11/common/eglonxbackend.cpp -+++ b/src/plugins/platforms/x11/common/eglonxbackend.cpp -@@ -213,15 +213,19 @@ - return EGL_NO_SURFACE; - } - -+ // Window is 64 bits on a 64-bit architecture whereas xcb_window_t is always 32 bits. -+ Window nativeWindow = window; -+ - EGLSurface surface = EGL_NO_SURFACE; - if (havePlatformBase()) { -- // Note: Window is 64 bits on a 64-bit architecture whereas xcb_window_t is -- // always 32 bits. eglCreatePlatformWindowSurfaceEXT() expects the -- // native_window parameter to be pointer to a Window, so this variable -- // cannot be an xcb_window_t. -- surface = eglCreatePlatformWindowSurfaceEXT(eglDisplay(), config(), (void *) &window, nullptr); -+ // eglCreatePlatformWindowSurfaceEXT() expects a pointer to the Window. -+ surface = eglCreatePlatformWindowSurfaceEXT(eglDisplay(), config(), (void *) &nativeWindow, nullptr); - } else { -- surface = eglCreateWindowSurface(eglDisplay(), config(), window, nullptr); -+ // eglCreateWindowSurface() expects a Window, not a pointer to the Window. Use -+ // a c style cast as there are (buggy) platforms where the size of the Window -+ // type is not the same as the size of EGLNativeWindowType, reinterpret_cast<>() -+ // may not compile. -+ surface = eglCreateWindowSurface(eglDisplay(), config(), (EGLNativeWindowType) nativeWindow, nullptr); - } - - return surface; diff --git a/kde-plasma/kwin/files/kwin-5.23.4-drm-remove-dpms-filter-when-outputs-are-added.patch b/kde-plasma/kwin/files/kwin-5.23.4-drm-remove-dpms-filter-when-outputs-are-added.patch new file mode 100644 index 000000000000..cc323e4540f6 --- /dev/null +++ b/kde-plasma/kwin/files/kwin-5.23.4-drm-remove-dpms-filter-when-outputs-are-added.patch @@ -0,0 +1,30 @@ +From 8a0036fdee0eaa7dc5808dfe2dfc516fc32dfd8e Mon Sep 17 00:00:00 2001 +From: Xaver Hugl +Date: Thu, 9 Dec 2021 12:51:55 +0100 +Subject: [PATCH] platforms/drm: remove the dpms filter when outputs are added + +When the dpms filter is active and an output is hotunplugged, or +is momentarily detected as hotunplugged, adding a new output should +remove the dpms filter again. + +BUG: 446699 +FIXED-IN: 5.23.5 +--- + src/plugins/platforms/drm/drm_backend.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/plugins/platforms/drm/drm_backend.cpp b/src/plugins/platforms/drm/drm_backend.cpp +index a99b720177..d7908f6332 100644 +--- a/src/plugins/platforms/drm/drm_backend.cpp ++++ b/src/plugins/platforms/drm/drm_backend.cpp +@@ -321,6 +321,7 @@ void DrmBackend::addOutput(DrmAbstractOutput *o) + primaryGpu()->removeVirtualOutput(m_placeHolderOutput); + m_placeHolderOutput = nullptr; + } ++ checkOutputsAreOn(); + } + + void DrmBackend::removeOutput(DrmAbstractOutput *o) +-- +GitLab + diff --git a/kde-plasma/kwin/files/kwin-5.23.4-fix-memory-leak-caching-QSGTexture.patch b/kde-plasma/kwin/files/kwin-5.23.4-fix-memory-leak-caching-QSGTexture.patch new file mode 100644 index 000000000000..5abcfa49969c --- /dev/null +++ b/kde-plasma/kwin/files/kwin-5.23.4-fix-memory-leak-caching-QSGTexture.patch @@ -0,0 +1,50 @@ +From 8accc777a5b3ab1e53341f1838ed636652dc1221 Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Mon, 13 Dec 2021 12:53:32 +0200 +Subject: [PATCH] Fix memory leak in some plasma components + +A few plasma components cache QSGTexture. Those components rely on +texture references going away with QSGNode users. However, with the +current tear down logic, OffscreenQuickView won't destroy any paint +nodes. + +Destroy QQuickRenderControl before QQuickWindow to ensure that are no +paint nodes left alive after OffscreenQuickView. + +BUG: 444429 +BUG: 444381 +BUG: 444077 +BUG: 444306 +(cherry picked from commit 64f2cdf9ed290a1fb7c2bf41753613078eb023c4) +--- + src/libkwineffects/kwineffectquickview.cpp | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/libkwineffects/kwineffectquickview.cpp b/src/libkwineffects/kwineffectquickview.cpp +index ca5a025729..14be1e1b25 100644 +--- a/src/libkwineffects/kwineffectquickview.cpp ++++ b/src/libkwineffects/kwineffectquickview.cpp +@@ -160,13 +160,15 @@ EffectQuickView::EffectQuickView(QObject *parent, QWindow *renderWindow, ExportM + EffectQuickView::~EffectQuickView() + { + if (d->m_glcontext) { +- d->m_glcontext->makeCurrent(d->m_offscreenSurface.data()); + // close the view whilst we have an active GL context +- delete d->m_view; +- d->m_view = nullptr; +- d->m_renderControl->invalidate(); +- d->m_glcontext->doneCurrent(); ++ d->m_glcontext->makeCurrent(d->m_offscreenSurface.data()); + } ++ ++ delete d->m_renderControl; // Always delete render control first. ++ d->m_renderControl = nullptr; ++ ++ delete d->m_view; ++ d->m_view = nullptr; + } + + bool EffectQuickView::automaticRepaint() const +-- +GitLab + diff --git a/kde-plasma/kwin/files/kwin-5.23.4-scripting-fix-KWinComponents-Workspace-type.patch b/kde-plasma/kwin/files/kwin-5.23.4-scripting-fix-KWinComponents-Workspace-type.patch new file mode 100644 index 000000000000..6ec6a59cd59f --- /dev/null +++ b/kde-plasma/kwin/files/kwin-5.23.4-scripting-fix-KWinComponents-Workspace-type.patch @@ -0,0 +1,34 @@ +From fd8d01d9892f12c48a82c6e2ab675396bf6ec113 Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Sun, 5 Dec 2021 18:24:35 +0200 +Subject: [PATCH] scripting: Fix type of KWinComponents.Workspace + +Currently, the workspace.clients property doesn't work in declarative +scripts because wrong workspace wrapper is used. + + +(cherry picked from commit 29a85e830cdca5ae483b411e942e7a5bf85f6140) +--- + src/scripting/scripting.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp +index b901db7455..929c94afab 100644 +--- a/src/scripting/scripting.cpp ++++ b/src/scripting/scripting.cpp +@@ -650,10 +650,10 @@ void KWin::Scripting::init() + qmlRegisterType("org.kde.kwin", 3, 0, "ClientModel"); + qmlRegisterType("org.kde.kwin", 3, 0, "ClientFilterModel"); + +- qmlRegisterSingletonType("org.kde.kwin", 3, 0, "Workspace", [](QQmlEngine *qmlEngine, QJSEngine *jsEngine) { ++ qmlRegisterSingletonType("org.kde.kwin", 3, 0, "Workspace", [](QQmlEngine *qmlEngine, QJSEngine *jsEngine) { + Q_UNUSED(qmlEngine) + Q_UNUSED(jsEngine) +- return new QtScriptWorkspaceWrapper(); ++ return new DeclarativeScriptWorkspaceWrapper(); + }); + + qmlRegisterType(); +-- +GitLab + diff --git a/kde-plasma/kwin/files/kwin-5.23.4-wayland-resize-to-last-requested-client-size.patch b/kde-plasma/kwin/files/kwin-5.23.4-wayland-resize-to-last-requested-client-size.patch new file mode 100644 index 000000000000..7846681ed528 --- /dev/null +++ b/kde-plasma/kwin/files/kwin-5.23.4-wayland-resize-to-last-requested-client-size.patch @@ -0,0 +1,100 @@ +From 6a84b9454c869a16c2fa5fd49a8fac4a9497f30f Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Tue, 7 Dec 2021 09:32:33 +0200 +Subject: [PATCH] wayland: Resize the client to last requested client size if + decoration is destroyed + +If the decoration is destroyed before the window is mapped, kwin can +respond with a configure event that has 0x0 size. New tests check that +problematic case. + +BUG: 444962 +(cherry picked from commit 9cc80d7468c92a2800daf98319e626e022ff1045) +--- + autotests/integration/xdgshellclient_test.cpp | 48 +++++++++++++++++++ + src/abstract_client.cpp | 3 +- + 2 files changed, 50 insertions(+), 1 deletion(-) + +diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp +index c00e4ebb2d..eabed754dd 100644 +--- a/autotests/integration/xdgshellclient_test.cpp ++++ b/autotests/integration/xdgshellclient_test.cpp +@@ -104,6 +104,8 @@ private Q_SLOTS: + void testPointerInputTransform(); + void testReentrantSetFrameGeometry(); + void testDoubleMaximize(); ++ void testMaximizeAndChangeDecorationModeAfterInitialCommit(); ++ void testFullScreenAndChangeDecorationModeAfterInitialCommit(); + }; + + void TestXdgShellClient::testXdgWindowReactive() +@@ -1839,5 +1841,51 @@ void TestXdgShellClient::testMaximizeFull() + QVERIFY(Test::waitForWindowDestroyed(client)); + } + ++void TestXdgShellClient::testMaximizeAndChangeDecorationModeAfterInitialCommit() ++{ ++ // Ideally, the app would initialize the xdg-toplevel surface before the initial commit, but ++ // many don't do it. They initialize the surface after the first commit. ++ // This test verifies that the client will receive a configure event with correct size ++ // if an xdg-toplevel surface is set maximized and decoration mode changes after initial commit. ++ ++ QScopedPointer surface(Test::createSurface()); ++ QScopedPointer shellSurface(Test::createXdgToplevelSurface(surface.data())); // will wait for the first configure event ++ QScopedPointer decoration(Test::createXdgToplevelDecorationV1(shellSurface.data())); ++ QSignalSpy toplevelConfigureRequestedSpy(shellSurface.data(), &Test::XdgToplevel::configureRequested); ++ QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested); ++ ++ // Request maximized mode and set decoration mode, i.e. perform late initialization. ++ shellSurface->set_maximized(); ++ decoration->set_mode(Test::XdgToplevelDecorationV1::mode_client_side); ++ ++ // The compositor will respond with a new configure event, which should contain maximized state. ++ QVERIFY(surfaceConfigureRequestedSpy.wait()); ++ QCOMPARE(toplevelConfigureRequestedSpy.last().at(0).value(), QSize(1280, 1024)); ++ QCOMPARE(toplevelConfigureRequestedSpy.last().at(1).value(), Test::XdgToplevel::State::Maximized); ++} ++ ++void TestXdgShellClient::testFullScreenAndChangeDecorationModeAfterInitialCommit() ++{ ++ // Ideally, the app would initialize the xdg-toplevel surface before the initial commit, but ++ // many don't do it. They initialize the surface after the first commit. ++ // This test verifies that the client will receive a configure event with correct size ++ // if an xdg-toplevel surface is set fullscreen and decoration mode changes after initial commit. ++ ++ QScopedPointer surface(Test::createSurface()); ++ QScopedPointer shellSurface(Test::createXdgToplevelSurface(surface.data())); // will wait for the first configure event ++ QScopedPointer decoration(Test::createXdgToplevelDecorationV1(shellSurface.data())); ++ QSignalSpy toplevelConfigureRequestedSpy(shellSurface.data(), &Test::XdgToplevel::configureRequested); ++ QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested); ++ ++ // Request fullscreen mode and set decoration mode, i.e. perform late initialization. ++ shellSurface->set_fullscreen(nullptr); ++ decoration->set_mode(Test::XdgToplevelDecorationV1::mode_client_side); ++ ++ // The compositor will respond with a new configure event, which should contain fullscreen state. ++ QVERIFY(surfaceConfigureRequestedSpy.wait()); ++ QCOMPARE(toplevelConfigureRequestedSpy.last().at(0).value(), QSize(1280, 1024)); ++ QCOMPARE(toplevelConfigureRequestedSpy.last().at(1).value(), Test::XdgToplevel::State::Fullscreen); ++} ++ + WAYLANDTEST_MAIN(TestXdgShellClient) + #include "xdgshellclient_test.moc" +diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp +index 79c079109a..95576de0b1 100644 +--- a/src/abstract_client.cpp ++++ b/src/abstract_client.cpp +@@ -2361,8 +2361,9 @@ void AbstractClient::createDecoration(const QRect &oldGeometry) + + void AbstractClient::destroyDecoration() + { ++ const QSize clientSize = frameSizeToClientSize(moveResizeGeometry().size()); + setDecoration(nullptr); +- resize(clientSizeToFrameSize(clientSize())); ++ resize(clientSize); + } + + void AbstractClient::setDecoration(KDecoration2::Decoration *decoration) +-- +GitLab + diff --git a/kde-plasma/kwin/files/kwin-5.23.4-xdgshell-protect-from-invalid-frameGeometry.patch b/kde-plasma/kwin/files/kwin-5.23.4-xdgshell-protect-from-invalid-frameGeometry.patch new file mode 100644 index 000000000000..a80348be3562 --- /dev/null +++ b/kde-plasma/kwin/files/kwin-5.23.4-xdgshell-protect-from-invalid-frameGeometry.patch @@ -0,0 +1,36 @@ +From 77b678c522cce0e8e7b39087f74e2ac591cd28d0 Mon Sep 17 00:00:00 2001 +From: Ismael Asensio +Date: Sun, 12 Dec 2021 15:16:28 +0100 +Subject: [PATCH] XDGShellClient: Protect from invalid frameGeometry on + updateDecoration + +When updating window decoration do not try to restore the previous frameGeometry +if it was invalid. + +This fixes the case when applying a `noBorder=true` rule on a newly created +client would set it to a minimal window size + +Targeted at 5.23 only, since this codepath is being reworked for 5.24 + +BUG: 445140 +FIXED-IN: 5.23.5 +--- + src/xdgshellclient.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp +index b4427b8cf7..75c4031498 100644 +--- a/src/xdgshellclient.cpp ++++ b/src/xdgshellclient.cpp +@@ -637,7 +637,7 @@ void XdgToplevelClient::updateDecoration(bool check_workspace_pos, bool force) + scheduleConfigure(); + } + updateShadow(); +- if (check_workspace_pos) { ++ if (check_workspace_pos && oldFrameGeometry.isValid()) { + const QRect oldGeometryRestore = geometryRestore(); + setGeometryRestore(frameGeometry()); + checkWorkspacePosition(oldFrameGeometry, oldClientGeometry); +-- +GitLab + -- cgit v1.2.3