commit:     cb2f22e3e5634860303b198e6b5a4450865d9009
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 18:12:40 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue May 17 19:01:45 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb2f22e3

kde-plasma/kwin: Backport several 5.24.6 fixes

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../kwin-5.24.5-effects-overview-hide-panels.patch |  65 ++++++++++
 .../kwin-5.24.5-fix-multi-gpu-double-copy.patch    |  59 +++++++++
 .../kwin-5.24.5-fix-nvidia-render-glitches.patch   |  42 +++++++
 .../kwin-5.24.5-tabbox-dont-dismiss-popups.patch   |  32 +++++
 kde-plasma/kwin/kwin-5.24.5-r1.ebuild              | 140 +++++++++++++++++++++
 5 files changed, 338 insertions(+)

diff --git 
a/kde-plasma/kwin/files/kwin-5.24.5-effects-overview-hide-panels.patch 
b/kde-plasma/kwin/files/kwin-5.24.5-effects-overview-hide-panels.patch
new file mode 100644
index 000000000000..d5b1f8c3864e
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.24.5-effects-overview-hide-panels.patch
@@ -0,0 +1,65 @@
+From 7fcf36d636f62f101397d88ad6c448f54da79e46 Mon Sep 17 00:00:00 2001
+From: Marco Martin <notm...@gmail.com>
+Date: Fri, 13 May 2022 15:37:13 +0000
+Subject: [PATCH] effects/overview: hide panels
+
+This makes it consistent with WindowView (and the panel window doesn't respond
+to input anyways even if shown, which is misleading).
+
+BUG: 444274
+FIXED-IN: 5.24.6
+
+
+(cherry picked from commit db2af5500f964f3eefde60183b69f21125aeb194)
+---
+ src/effects/overview/qml/ScreenView.qml | 20 ++++++++------------
+ 1 file changed, 8 insertions(+), 12 deletions(-)
+
+diff --git a/src/effects/overview/qml/ScreenView.qml 
b/src/effects/overview/qml/ScreenView.qml
+index 40cc29f4c7..39119e40b9 100644
+--- a/src/effects/overview/qml/ScreenView.qml
++++ b/src/effects/overview/qml/ScreenView.qml
+@@ -70,16 +70,8 @@ FocusScope {
+         }
+     }
+ 
+-    ExpoArea {
+-        id: heapArea
+-        screen: targetScreen
+-    }
+-
+     Column {
+-        x: heapArea.x
+-        y: heapArea.y
+-        width: heapArea.width
+-        height: heapArea.height
++        anchors.fill: parent
+ 
+         Item {
+             id: topBar
+@@ -176,15 +168,19 @@ FocusScope {
+ 
+         KWinComponents.WindowThumbnailItem {
+             id: windowThumbnail
+-            visible: !model.client.hidden
++            visible: !model.client.hidden && opacity > 0
+             wId: model.client.internalId
+             x: model.client.x - targetScreen.geometry.x
+             y: model.client.y - targetScreen.geometry.y
+             width: model.client.width
+             height: model.client.height
++            opacity: container.effect.gestureInProgress
++                ? 1 - container.effect.partialActivationFactor
++                : (model.client.hidden || container.organized) ? 0 : 1
+ 
+-            TapHandler {
+-                onTapped: effect.deactivate();
++            Behavior on opacity {
++                enabled: !container.effect.gestureInProgress
++                NumberAnimation { duration: animationDuration; easing.type: 
Easing.OutCubic }
+             }
+         }
+     }
+-- 
+GitLab
+

diff --git a/kde-plasma/kwin/files/kwin-5.24.5-fix-multi-gpu-double-copy.patch 
b/kde-plasma/kwin/files/kwin-5.24.5-fix-multi-gpu-double-copy.patch
new file mode 100644
index 000000000000..53c05da522ec
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.24.5-fix-multi-gpu-double-copy.patch
@@ -0,0 +1,59 @@
+From 3b58fe4bde0722b352e4114adb992a2ed2c96423 Mon Sep 17 00:00:00 2001
+From: Xaver Hugl <xaver.h...@gmail.com>
+Date: Sat, 7 May 2022 21:23:17 +0200
+Subject: [PATCH] backends/drm: consider escaped separators KWIN_DRM_DEVICES
+
+':' conflicts with the file names in /dev/dri/by-path, so allow it to be
+escaped with '\'
+
+CCBUG: 453386
+
+
+(cherry picked from commit a110aabbccf56019bdc324b3c751112f35ec3f6c)
+---
+ src/backends/drm/drm_backend.cpp | 24 +++++++++++++++++++++++-
+ 1 file changed, 23 insertions(+), 1 deletion(-)
+
+diff --git a/src/backends/drm/drm_backend.cpp 
b/src/backends/drm/drm_backend.cpp
+index 272dba702c..567ea3f696 100644
+--- a/src/backends/drm/drm_backend.cpp
++++ b/src/backends/drm/drm_backend.cpp
+@@ -57,12 +57,34 @@
+ namespace KWin
+ {
+ 
++static QStringList splitPathList(const QString &input, const QChar delimiter)
++{
++    QStringList ret;
++    QString tmp;
++    for (int i = 0; i < input.size(); i++) {
++        if (input[i] == delimiter) {
++            if (i > 0 && input[i - 1] == '\\') {
++                tmp[tmp.size() - 1] = delimiter;
++            } else if (!tmp.isEmpty()) {
++                ret.append(tmp);
++                tmp = QString();
++            }
++        } else {
++            tmp.append(input[i]);
++        }
++    }
++    if (!tmp.isEmpty()) {
++        ret.append(tmp);
++    }
++    return ret;
++}
++
+ DrmBackend::DrmBackend(QObject *parent)
+     : Platform(parent)
+     , m_udev(new Udev)
+     , m_udevMonitor(m_udev->monitor())
+     , m_session(Session::create(this))
+-    , m_explicitGpus(qEnvironmentVariable("KWIN_DRM_DEVICES").split(':', 
Qt::SkipEmptyParts))
++    , m_explicitGpus(splitPathList(qEnvironmentVariable("KWIN_DRM_DEVICES"), 
':'))
+     , m_dpmsFilter()
+ {
+     setSupportsPointerWarping(true);
+-- 
+GitLab
+

diff --git a/kde-plasma/kwin/files/kwin-5.24.5-fix-nvidia-render-glitches.patch 
b/kde-plasma/kwin/files/kwin-5.24.5-fix-nvidia-render-glitches.patch
new file mode 100644
index 000000000000..d38e11375bbe
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.24.5-fix-nvidia-render-glitches.patch
@@ -0,0 +1,42 @@
+From e2d271b6365188a86755af82745ad37535ceb4d7 Mon Sep 17 00:00:00 2001
+From: Erik Kurzinger <ekurzin...@nvidia.com>
+Date: Sun, 8 May 2022 12:16:20 -0700
+Subject: [PATCH] platforms/drm: set read buffer in
+ GbmSurface::makeContextCurrent
+
+The first time the GBM backend's EGL context is made current after
+creation, both the read and draw surfaces are set to EGL_NO_SURFACE.
+This will set the GL read and draw buffers to GL_NONE in accordance with
+the EGL spec.
+
+When a real surface is later made current, however, the spec is arguably
+unclear on whether the read and draw buffers should remain set to
+GL_NONE or whether they should be restored to the default GL_BACK.  The
+Mesa driver does the latter, the NVIDIA driver does the former.
+
+To work around this difference, Kwin has an explicit call to
+glDrawBuffer in GbmSurface::makeContextCurrent. It does not have a
+corresponding call to glReadBuffer, though, which can cause some desktop
+effects such as background contrast to render incorrectly with the
+NVIDIA driver. This change adds that missing call.
+
+(cherry picked from commit e6d2bc153f499d1ec3510c02badca38d4c42c340)
+---
+ src/backends/drm/egl_gbm_backend.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/backends/drm/egl_gbm_backend.cpp 
b/src/backends/drm/egl_gbm_backend.cpp
+index 5a0be7ccaf..b34fa1320b 100644
+--- a/src/backends/drm/egl_gbm_backend.cpp
++++ b/src/backends/drm/egl_gbm_backend.cpp
+@@ -377,6 +377,7 @@ bool EglGbmBackend::makeContextCurrent(const 
Output::RenderData &render) const
+     }
+     if (!GLPlatform::instance()->isGLES()) {
+         glDrawBuffer(GL_BACK);
++        glReadBuffer(GL_BACK);
+     }
+     return true;
+ }
+-- 
+GitLab
+

diff --git a/kde-plasma/kwin/files/kwin-5.24.5-tabbox-dont-dismiss-popups.patch 
b/kde-plasma/kwin/files/kwin-5.24.5-tabbox-dont-dismiss-popups.patch
new file mode 100644
index 000000000000..f79d4bba71ce
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.24.5-tabbox-dont-dismiss-popups.patch
@@ -0,0 +1,32 @@
+From f7b1edc79e9526fe6bad69a8ad475a5d77e5aead Mon Sep 17 00:00:00 2001
+From: Xaver Hugl <xaver.h...@gmail.com>
+Date: Tue, 10 May 2022 13:07:03 +0200
+Subject: [PATCH] tabbox: don't dismiss popups
+
+The glitches that dismissing popups was supposed to prevent are apparently
+no longer present.
+
+BUG: 446318
+(cherry picked from commit 94b0ca814688bf3622aa53f4d4d26f97d8de7306)
+---
+ src/tabbox/tabbox.cpp | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/tabbox/tabbox.cpp b/src/tabbox/tabbox.cpp
+index a1c50b27fc..76a50795ad 100644
+--- a/src/tabbox/tabbox.cpp
++++ b/src/tabbox/tabbox.cpp
+@@ -1020,10 +1020,6 @@ void TabBox::navigatingThroughWindows(bool forward, 
const QKeySequence &shortcut
+         // CDE style raise / lower
+         CDEWalkThroughWindows(forward);
+     } else {
+-        workspace()->forEachAbstractClient([](Toplevel *toplevel) {
+-            if (toplevel->isPopupWindow())
+-                toplevel->popupDone();
+-        });
+         if (areModKeysDepressed(shortcut)) {
+             if (startKDEWalkThroughWindows(mode))
+                 KDEWalkThroughWindows(forward);
+-- 
+GitLab
+

diff --git a/kde-plasma/kwin/kwin-5.24.5-r1.ebuild 
b/kde-plasma/kwin/kwin-5.24.5-r1.ebuild
new file mode 100644
index 000000000000..12d15b83a199
--- /dev/null
+++ b/kde-plasma/kwin/kwin-5.24.5-r1.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_HANDBOOK="optional"
+ECM_TEST="optional"
+KFMIN=5.90.0
+PVCUT=$(ver_cut 1-3)
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org optfeature
+
+DESCRIPTION="Flexible, composited Window Manager for windowing systems on 
Linux"
+
+LICENSE="GPL-2+"
+SLOT="5"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="accessibility caps gles2-only multimedia plasma screencast"
+
+RESTRICT="test"
+
+COMMON_DEPEND="
+       >=dev-libs/libinput-1.19
+       >=dev-libs/wayland-1.2
+       >=dev-qt/qtdbus-${QTMIN}:5
+       >=dev-qt/qtdeclarative-${QTMIN}:5
+       >=dev-qt/qtgui-${QTMIN}:5=[gles2-only=,libinput]
+       >=dev-qt/qtwidgets-${QTMIN}:5
+       >=dev-qt/qtx11extras-${QTMIN}:5
+       >=kde-frameworks/kactivities-${KFMIN}:5
+       >=kde-frameworks/kauth-${KFMIN}:5
+       >=kde-frameworks/kcmutils-${KFMIN}:5
+       >=kde-frameworks/kcompletion-${KFMIN}:5
+       >=kde-frameworks/kconfig-${KFMIN}:5
+       >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+       >=kde-frameworks/kcoreaddons-${KFMIN}:5
+       >=kde-frameworks/kcrash-${KFMIN}:5
+       >=kde-frameworks/kdbusaddons-${KFMIN}:5
+       >=kde-frameworks/kdeclarative-${KFMIN}:5
+       >=kde-frameworks/kglobalaccel-${KFMIN}:5=
+       >=kde-frameworks/ki18n-${KFMIN}:5
+       >=kde-frameworks/kiconthemes-${KFMIN}:5
+       >=kde-frameworks/kidletime-${KFMIN}:5=
+       >=kde-frameworks/knewstuff-${KFMIN}:5
+       >=kde-frameworks/knotifications-${KFMIN}:5
+       >=kde-frameworks/kpackage-${KFMIN}:5
+       >=kde-frameworks/kservice-${KFMIN}:5
+       >=kde-frameworks/ktextwidgets-${KFMIN}:5
+       >=kde-frameworks/kwayland-${KFMIN}:5
+       >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+       >=kde-frameworks/kwindowsystem-${KFMIN}:5=[X]
+       >=kde-frameworks/kxmlgui-${KFMIN}:5
+       >=kde-frameworks/plasma-${KFMIN}:5
+       >=kde-plasma/breeze-${PVCUT}:5
+       >=kde-plasma/kdecoration-${PVCUT}:5
+       >=kde-plasma/kscreenlocker-${PVCUT}:5
+       >=kde-plasma/kwayland-server-${PVCUT}:5
+       media-libs/fontconfig
+       media-libs/freetype
+       media-libs/lcms:2
+       media-libs/libepoxy
+       >=media-libs/mesa-21.1[egl(+),gbm(+),wayland,X]
+       virtual/libudev:=
+       x11-libs/libX11
+       x11-libs/libXi
+       x11-libs/libdrm
+       >=x11-libs/libxcb-1.10
+       >=x11-libs/libxkbcommon-0.7.0
+       x11-libs/xcb-util-cursor
+       x11-libs/xcb-util-image
+       x11-libs/xcb-util-keysyms
+       x11-libs/xcb-util-wm
+       accessibility? ( media-libs/libqaccessibilityclient:5 )
+       caps? ( sys-libs/libcap )
+       gles2-only? ( media-libs/mesa[gles2] )
+       plasma? ( >=kde-frameworks/krunner-${KFMIN}:5 )
+       screencast? ( >=media-video/pipewire-0.3:= )
+"
+RDEPEND="${COMMON_DEPEND}
+       >=dev-qt/qtquickcontrols-${QTMIN}:5
+       >=dev-qt/qtquickcontrols2-${QTMIN}:5
+       >=dev-qt/qtvirtualkeyboard-${QTMIN}:5
+       >=kde-frameworks/kirigami-${KFMIN}:5
+       >=kde-frameworks/kitemmodels-${KFMIN}:5[qml]
+       sys-apps/hwdata
+       x11-base/xwayland
+       multimedia? ( >=dev-qt/qtmultimedia-${QTMIN}:5[gstreamer,qml] )
+"
+DEPEND="${COMMON_DEPEND}
+       >=dev-qt/designer-${QTMIN}:5
+       >=dev-qt/qtconcurrent-${QTMIN}:5
+       x11-base/xorg-proto
+       test? (
+               dev-libs/plasma-wayland-protocols
+               >=dev-libs/wayland-protocols-1.19
+       )
+"
+BDEPEND="test? ( >=dev-qt/qtwaylandscanner-${QTMIN}:5 )"
+PDEPEND=">=kde-plasma/kde-cli-tools-${PVCUT}:5"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-fix-multi-gpu-double-copy.patch # KDE-bug 453386
+       "${FILESDIR}"/${P}-tabbox-dont-dismiss-popups.patch # KDE-bug 446318
+       "${FILESDIR}"/${P}-effects-overview-hide-panels.patch # KDE-bug 444274
+       "${FILESDIR}"/${P}-fix-nvidia-render-glitches.patch
+)
+
+src_prepare() {
+       ecm_src_prepare
+       use multimedia || eapply 
"${FILESDIR}/${PN}-5.21.80-gstreamer-optional.patch"
+
+       # TODO: try to get a build switch upstreamed
+       if ! use screencast; then
+               sed -e "s/^pkg_check_modules.*PipeWire/#&/" -i CMakeLists.txt 
|| die
+       fi
+}
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake_use_find_package accessibility QAccessibilityClient)
+               $(cmake_use_find_package caps Libcap)
+               $(cmake_use_find_package plasma KF5Runner)
+       )
+
+       ecm_src_configure
+}
+
+pkg_postinst() {
+       ecm_pkg_postinst
+       optfeature "color management support" x11-misc/colord
+       elog
+       elog "In Plasma 5.20, default behavior of the Task Switcher to move 
minimised"
+       elog "windows to the end of the list was changed so that it remains in 
the"
+       elog "original order. To revert to the well established behavior:"
+       elog
+       elog " - Edit ~/.config/kwinrc"
+       elog " - Find [TabBox] section"
+       elog " - Add \"MoveMinimizedWindowsToEndOfTabBoxFocusChain=true\""
+}

Reply via email to