commit:     901f280f4d7588a28776209d430fd2fea507f893
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 26 11:44:13 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Jul 26 12:04:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=901f280f

kde-plasma/kwin: effects/colorpicker: Fix picking colors

Also: Emit rowsChanged signal to fix default state highlighting.

Upstream commits:
4305425cb221139a7d9ed6cb954eb8e0b5627f5a
aa5fc42349052d040f45aca40749edce80ff8f1f

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=454974

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../kwin/files/kwin-5.24.6-emit-rowsChanged.patch  |  30 +++++
 .../kwin/files/kwin-5.24.6-fix-color-picker.patch  |  40 ++++++
 kde-plasma/kwin/kwin-5.24.6-r1.ebuild              | 138 +++++++++++++++++++++
 3 files changed, 208 insertions(+)

diff --git a/kde-plasma/kwin/files/kwin-5.24.6-emit-rowsChanged.patch 
b/kde-plasma/kwin/files/kwin-5.24.6-emit-rowsChanged.patch
new file mode 100644
index 000000000000..79ee3cc547ce
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.24.6-emit-rowsChanged.patch
@@ -0,0 +1,30 @@
+From 4f419afe307f808ab648a6d6c473ff3cd0b9d836 Mon Sep 17 00:00:00 2001
+From: ivan tkachenko <[email protected]>
+Date: Sun, 10 Jul 2022 15:17:26 +0300
+Subject: [PATCH] [kcm/kwindesktop] Emit rowsChanged signal to fix default
+ state highlighting
+
+Without this, the rowsChanged signal wasn't emitting at startup, so the
+binding `highlight: kcm.desktopsModel.rows !== 2` didn't work correctly.
+
+FIXED-IN: 5.24.7 5.25.3 5.26
+---
+ src/kcmkwin/kwindesktop/desktopsmodel.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/kcmkwin/kwindesktop/desktopsmodel.cpp 
b/src/kcmkwin/kwindesktop/desktopsmodel.cpp
+index cf147a7981..f8dd8d6260 100644
+--- a/src/kcmkwin/kwindesktop/desktopsmodel.cpp
++++ b/src/kcmkwin/kwindesktop/desktopsmodel.cpp
+@@ -457,6 +457,8 @@ void DesktopsModel::getAllAndConnect(const QDBusMessage 
&msg)
+         m_names = m_serverSideNames;
+         m_rows = m_serverSideRows;
+         endResetModel();
++
++        Q_EMIT rowsChanged();
+     }
+ 
+     Q_EMIT readyChanged();
+-- 
+GitLab
+

diff --git a/kde-plasma/kwin/files/kwin-5.24.6-fix-color-picker.patch 
b/kde-plasma/kwin/files/kwin-5.24.6-fix-color-picker.patch
new file mode 100644
index 000000000000..545bc96d0230
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.24.6-fix-color-picker.patch
@@ -0,0 +1,40 @@
+From aa5fc42349052d040f45aca40749edce80ff8f1f Mon Sep 17 00:00:00 2001
+From: ivan tkachenko <[email protected]>
+Date: Fri, 22 Jul 2022 18:43:45 +0300
+Subject: [PATCH] effects/colorpicker: Fix picking colors
+
+Due to the wrong buffer format, the function failed with
+GL_INVALID_OPERATION error, which was silently ignored by the effect.
+It resulted in the constant phantom color being returned over and over
+again.
+
+Co-Authored-By: David Edmundson <[email protected]>
+BUG: 454974
+FIXED-IN: 5.24.7, 5.25.4, 5.26
+(cherry picked from commit df6331b60aa03e65f146e93d0229cdc6dc956bbd)
+---
+ src/effects/colorpicker/colorpicker.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/effects/colorpicker/colorpicker.cpp 
b/src/effects/colorpicker/colorpicker.cpp
+index bc60225838..0625b3de47 100644
+--- a/src/effects/colorpicker/colorpicker.cpp
++++ b/src/effects/colorpicker/colorpicker.cpp
+@@ -61,12 +61,12 @@ void ColorPickerEffect::postPaintScreen()
+     effects->postPaintScreen();
+ 
+     if (m_scheduledPosition != QPoint(-1, -1) && (!m_paintedScreen || 
m_paintedScreen->geometry().contains(m_scheduledPosition))) {
+-        uint8_t data[3];
++        uint8_t data[4];
+         const QRect geo = GLRenderTarget::virtualScreenGeometry();
+         const QPoint screenPosition(m_scheduledPosition.x() - geo.x(), 
m_scheduledPosition.y() - geo.y());
+         const QPoint texturePosition(screenPosition.x() * 
GLRenderTarget::virtualScreenScale(), (geo.height() - screenPosition.y()) * 
GLRenderTarget::virtualScreenScale());
+ 
+-        glReadnPixels(texturePosition.x(), texturePosition.y(), 1, 1, GL_RGB, 
GL_UNSIGNED_BYTE, 3, data);
++        glReadnPixels(texturePosition.x(), texturePosition.y(), 1, 1, 
GL_RGBA, GL_UNSIGNED_BYTE, 4, data);
+         
QDBusConnection::sessionBus().send(m_replyMessage.createReply(QColor(data[0], 
data[1], data[2])));
+         m_picking = false;
+         m_scheduledPosition = QPoint(-1, -1);
+-- 
+GitLab
+

diff --git a/kde-plasma/kwin/kwin-5.24.6-r1.ebuild 
b/kde-plasma/kwin/kwin-5.24.6-r1.ebuild
new file mode 100644
index 000000000000..7c9960a24375
--- /dev/null
+++ b/kde-plasma/kwin/kwin-5.24.6-r1.ebuild
@@ -0,0 +1,138 @@
+# 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.92.0
+PVCUT=$(ver_cut 1-3)
+QTMIN=5.15.4
+VIRTUALX_REQUIRED="test"
+inherit ecm plasma.kde.org optfeature
+
+DESCRIPTION="Flexible, composited Window Manager for windowing systems on 
Linux"
+
+LICENSE="GPL-2+"
+SLOT="5"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~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}-emit-rowsChanged.patch"
+       "${FILESDIR}/${P}-fix-color-picker.patch" # KDE-bug 454974
+)
+
+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