Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-plasma/kwin/, kde-plasma/kwin/files/
Date: Tue, 23 Nov 2021 14:59:43
Message-Id: 1637679553.d8a6ce0f6db9297cb47efccfe21555e9706e424c.asturm@gentoo
1 commit: d8a6ce0f6db9297cb47efccfe21555e9706e424c
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 15 14:13:15 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 23 14:59:13 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8a6ce0f
7
8 kde-plasma/kwin: Fix XWayland abstract socket address
9
10 Upstream commit 5a9a3e96898bd29ccbf31d9ff92dfb80274ce265
11
12 KDE-bug: https://bugs.kde.org/show_bug.cgi?id=442362
13 Reported-by: Benn Snyder <benn.snyder <AT> gmail.com>
14 Bug: https://bugs.gentoo.org/813888
15 Package-Manager: Portage-3.0.28, Repoman-3.0.3
16 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
17
18 ...-5.23.3-fix-xwayland-abstract-socket-addr.patch | 49 ++++++++
19 kde-plasma/kwin/kwin-5.23.3-r1.ebuild | 138 +++++++++++++++++++++
20 2 files changed, 187 insertions(+)
21
22 diff --git a/kde-plasma/kwin/files/kwin-5.23.3-fix-xwayland-abstract-socket-addr.patch b/kde-plasma/kwin/files/kwin-5.23.3-fix-xwayland-abstract-socket-addr.patch
23 new file mode 100644
24 index 000000000000..7cd8d135ab28
25 --- /dev/null
26 +++ b/kde-plasma/kwin/files/kwin-5.23.3-fix-xwayland-abstract-socket-addr.patch
27 @@ -0,0 +1,49 @@
28 +From 5a9a3e96898bd29ccbf31d9ff92dfb80274ce265 Mon Sep 17 00:00:00 2001
29 +From: Weng Xuetian <wengxt@×××××.com>
30 +Date: Thu, 11 Nov 2021 12:25:13 -0800
31 +Subject: [PATCH] Fix XWayland abstract socket address.
32 +
33 +NUL-termination byte is not needed for abstract socket. This leads to
34 +XWayland listening to a wrong address.
35 +
36 +Confirmed with lsof.
37 +
38 +BUG: 442362
39 +
40 +
41 +(cherry picked from commit 83a036e9d40475d5c07177bf2e8bba9bc0fd4aa5)
42 +---
43 + src/xwl/lib/xwaylandsocket.cpp | 9 ++++-----
44 + 1 file changed, 4 insertions(+), 5 deletions(-)
45 +
46 +diff --git a/src/xwl/lib/xwaylandsocket.cpp b/src/xwl/lib/xwaylandsocket.cpp
47 +index 786ab5cbbf..7cf9310584 100644
48 +--- a/src/xwl/lib/xwaylandsocket.cpp
49 ++++ b/src/xwl/lib/xwaylandsocket.cpp
50 +@@ -42,19 +42,18 @@ UnixSocketAddress::UnixSocketAddress(const QString &socketPath, Type type)
51 + const QByteArray encodedSocketPath = QFile::encodeName(socketPath);
52 +
53 + int byteCount = offsetof(sockaddr_un, sun_path) + encodedSocketPath.size() + 1;
54 +- if (type == Type::Abstract) {
55 +- byteCount++; // For the first '\0'.
56 +- }
57 + m_buffer.resize(byteCount);
58 +
59 + sockaddr_un *address = reinterpret_cast<sockaddr_un *>(m_buffer.data());
60 + address->sun_family = AF_UNIX;
61 +
62 + if (type == Type::Unix) {
63 +- qstrcpy(address->sun_path, encodedSocketPath);
64 ++ memcpy(address->sun_path, encodedSocketPath.data(), encodedSocketPath.size());
65 ++ address->sun_path[encodedSocketPath.size()] = '\0';
66 + } else {
67 ++ // Abstract domain socket does not need the NUL-termination byte.
68 + *address->sun_path = '\0';
69 +- qstrcpy(address->sun_path + 1, encodedSocketPath);
70 ++ memcpy(address->sun_path + 1, encodedSocketPath.data(), encodedSocketPath.size());
71 + }
72 + }
73 +
74 +--
75 +GitLab
76 +
77
78 diff --git a/kde-plasma/kwin/kwin-5.23.3-r1.ebuild b/kde-plasma/kwin/kwin-5.23.3-r1.ebuild
79 new file mode 100644
80 index 000000000000..cf0d965820df
81 --- /dev/null
82 +++ b/kde-plasma/kwin/kwin-5.23.3-r1.ebuild
83 @@ -0,0 +1,138 @@
84 +# Copyright 1999-2021 Gentoo Authors
85 +# Distributed under the terms of the GNU General Public License v2
86 +
87 +EAPI=8
88 +
89 +ECM_HANDBOOK="optional"
90 +ECM_TEST="optional"
91 +KFMIN=5.86.0
92 +PVCUT=$(ver_cut 1-3)
93 +QTMIN=5.15.2
94 +VIRTUALX_REQUIRED="test"
95 +inherit ecm kde.org optfeature
96 +
97 +DESCRIPTION="Flexible, composited Window Manager for windowing systems on Linux"
98 +
99 +LICENSE="GPL-2+"
100 +SLOT="5"
101 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
102 +IUSE="accessibility caps gles2-only multimedia plasma screencast"
103 +
104 +RESTRICT="test"
105 +
106 +COMMON_DEPEND="
107 + >=dev-libs/libinput-1.14
108 + >=dev-libs/wayland-1.2
109 + >=dev-qt/qtdbus-${QTMIN}:5
110 + >=dev-qt/qtdeclarative-${QTMIN}:5
111 + >=dev-qt/qtgui-${QTMIN}:5=[gles2-only=,libinput]
112 + >=dev-qt/qtwidgets-${QTMIN}:5
113 + >=dev-qt/qtx11extras-${QTMIN}:5
114 + >=kde-frameworks/kactivities-${KFMIN}:5
115 + >=kde-frameworks/kauth-${KFMIN}:5
116 + >=kde-frameworks/kcmutils-${KFMIN}:5
117 + >=kde-frameworks/kcompletion-${KFMIN}:5
118 + >=kde-frameworks/kconfig-${KFMIN}:5
119 + >=kde-frameworks/kconfigwidgets-${KFMIN}:5
120 + >=kde-frameworks/kcoreaddons-${KFMIN}:5
121 + >=kde-frameworks/kcrash-${KFMIN}:5
122 + >=kde-frameworks/kdeclarative-${KFMIN}:5
123 + >=kde-frameworks/kglobalaccel-${KFMIN}:5=
124 + >=kde-frameworks/ki18n-${KFMIN}:5
125 + >=kde-frameworks/kiconthemes-${KFMIN}:5
126 + >=kde-frameworks/kidletime-${KFMIN}:5=
127 + >=kde-frameworks/knewstuff-${KFMIN}:5
128 + >=kde-frameworks/knotifications-${KFMIN}:5
129 + >=kde-frameworks/kpackage-${KFMIN}:5
130 + >=kde-frameworks/kservice-${KFMIN}:5
131 + >=kde-frameworks/ktextwidgets-${KFMIN}:5
132 + >=kde-frameworks/kwayland-${KFMIN}:5
133 + >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
134 + >=kde-frameworks/kwindowsystem-${KFMIN}:5=[X]
135 + >=kde-frameworks/kxmlgui-${KFMIN}:5
136 + >=kde-frameworks/plasma-${KFMIN}:5
137 + >=kde-plasma/breeze-${PVCUT}:5
138 + >=kde-plasma/kdecoration-${PVCUT}:5
139 + >=kde-plasma/kscreenlocker-${PVCUT}:5
140 + >=kde-plasma/kwayland-server-${PVCUT}:5
141 + media-libs/fontconfig
142 + media-libs/freetype
143 + media-libs/lcms:2
144 + media-libs/libepoxy
145 + >=media-libs/mesa-21.1[egl(+),gbm(+),wayland,X]
146 + virtual/libudev:=
147 + x11-libs/libX11
148 + x11-libs/libXi
149 + x11-libs/libdrm
150 + >=x11-libs/libxcb-1.10
151 + >=x11-libs/libxkbcommon-0.7.0
152 + x11-libs/xcb-util-cursor
153 + x11-libs/xcb-util-image
154 + x11-libs/xcb-util-keysyms
155 + x11-libs/xcb-util-wm
156 + accessibility? ( media-libs/libqaccessibilityclient:5 )
157 + caps? ( sys-libs/libcap )
158 + gles2-only? ( media-libs/mesa[gles2] )
159 + plasma? ( >=kde-frameworks/krunner-${KFMIN}:5 )
160 + screencast? ( >=media-video/pipewire-0.3:= )
161 +"
162 +# TODO: sys-apps/hwdata? not packaged yet; commit 33a1777a, Gentoo-bug 717216
163 +RDEPEND="${COMMON_DEPEND}
164 + >=dev-qt/qtquickcontrols-${QTMIN}:5
165 + >=dev-qt/qtquickcontrols2-${QTMIN}:5
166 + >=dev-qt/qtvirtualkeyboard-${QTMIN}:5
167 + >=kde-frameworks/kirigami-${KFMIN}:5
168 + >=kde-frameworks/kitemmodels-${KFMIN}:5[qml]
169 + || (
170 + x11-base/xwayland
171 + x11-base/xorg-server[wayland(-)]
172 + )
173 + multimedia? ( >=dev-qt/qtmultimedia-${QTMIN}:5[gstreamer,qml] )
174 +"
175 +DEPEND="${COMMON_DEPEND}
176 + >=dev-qt/designer-${QTMIN}:5
177 + >=dev-qt/qtconcurrent-${QTMIN}:5
178 + x11-base/xorg-proto
179 + test? (
180 + >=dev-libs/wayland-protocols-1.19
181 + >=dev-qt/qtwayland-${QTMIN}:5
182 + )
183 +"
184 +PDEPEND=">=kde-plasma/kde-cli-tools-${PVCUT}:5"
185 +
186 +PATCHES=(
187 + "${FILESDIR}/${P}-fix-xwayland-abstract-socket-addr.patch" # KDE-bug 442362, bug 813888
188 +)
189 +
190 +src_prepare() {
191 + ecm_src_prepare
192 + use multimedia || eapply "${FILESDIR}/${PN}-5.21.80-gstreamer-optional.patch"
193 +
194 + # TODO: try to get a build switch upstreamed
195 + if ! use screencast; then
196 + sed -e "s/^pkg_check_modules.*PipeWire/#&/" -i CMakeLists.txt || die
197 + fi
198 +}
199 +
200 +src_configure() {
201 + local mycmakeargs=(
202 + $(cmake_use_find_package accessibility QAccessibilityClient)
203 + $(cmake_use_find_package caps Libcap)
204 + $(cmake_use_find_package plasma KF5Runner)
205 + )
206 +
207 + ecm_src_configure
208 +}
209 +
210 +pkg_postinst() {
211 + ecm_pkg_postinst
212 + optfeature "color management support" x11-misc/colord
213 + elog
214 + elog "In Plasma 5.20, default behavior of the Task Switcher to move minimised"
215 + elog "windows to the end of the list was changed so that it remains in the"
216 + elog "original order. To revert to the well established behavior:"
217 + elog
218 + elog " - Edit ~/.config/kwinrc"
219 + elog " - Find [TabBox] section"
220 + elog " - Add \"MoveMinimizedWindowsToEndOfTabBoxFocusChain=true\""
221 +}