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/kscreen/files/, kde-plasma/kscreen/
Date: Mon, 30 May 2022 16:09:38
Message-Id: 1653926943.591b28d3c215f9bab4ee3cc77087191b3403a08a.asturm@gentoo
1 commit: 591b28d3c215f9bab4ee3cc77087191b3403a08a
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 30 15:25:40 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Mon May 30 16:09:03 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=591b28d3
7
8 kde-plasma/kscreen: X11: fix kded xcb resource leak
9
10 Upstream commit 93cfd297506e4106a7b6e7bcc649442c5bf0f7d1
11 KDE-bug: https://bugs.kde.org/show_bug.cgi?id=453280
12
13 Package-Manager: Portage-3.0.30, Repoman-3.0.3
14 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
15
16 ...screen-5.24.5-fix-kded-xcb-resources-leak.patch | 61 ++++++++++++++++++++++
17 kde-plasma/kscreen/kscreen-5.24.5-r2.ebuild | 53 +++++++++++++++++++
18 2 files changed, 114 insertions(+)
19
20 diff --git a/kde-plasma/kscreen/files/kscreen-5.24.5-fix-kded-xcb-resources-leak.patch b/kde-plasma/kscreen/files/kscreen-5.24.5-fix-kded-xcb-resources-leak.patch
21 new file mode 100644
22 index 000000000000..ecba1664c51c
23 --- /dev/null
24 +++ b/kde-plasma/kscreen/files/kscreen-5.24.5-fix-kded-xcb-resources-leak.patch
25 @@ -0,0 +1,61 @@
26 +From 93cfd297506e4106a7b6e7bcc649442c5bf0f7d1 Mon Sep 17 00:00:00 2001
27 +From: Stefan Becker <chemobejk@×××××.com>
28 +Date: Sun, 29 May 2022 23:33:55 +0300
29 +Subject: [PATCH] X11: fix kded xcb resource leak
30 +
31 +This fixes commit 579358f501ae978aa527a25eb3ef9dd42557db46
32 +
33 +XOpenDisplay() internally calls xcb_connect(), creating a new XCB client
34 +connection. This means that on every KScreen configuration change event
35 +the kded5 process creates a new connection until XCB runs into the hard
36 +limit of 256 of clients, leading to the dreaded "Maximum number of
37 +clients reached" error.
38 +
39 +Re-use the display from QX11Info instead of calling XOpenDisplay().
40 +
41 +BUG: 453280
42 +
43 +
44 +(cherry picked from commit 0270a49328aa70b14dd08e2ed5a425ca3f8e4fd5)
45 +---
46 + kded/daemon.cpp | 17 ++++++++---------
47 + 1 file changed, 8 insertions(+), 9 deletions(-)
48 +
49 +diff --git a/kded/daemon.cpp b/kded/daemon.cpp
50 +index e8ed4ac..443d98d 100644
51 +--- a/kded/daemon.cpp
52 ++++ b/kded/daemon.cpp
53 +@@ -361,6 +361,14 @@ void KScreenDaemon::alignX11TouchScreen()
54 + if (qGuiApp->platformName() != QStringLiteral("xcb")) {
55 + return;
56 + }
57 ++ auto *display = QX11Info::display();
58 ++ if (!display) {
59 ++ return;
60 ++ }
61 ++ auto *connection = QX11Info::connection();
62 ++ if (!connection) {
63 ++ return;
64 ++ }
65 +
66 + const QRect totalRect(QPoint(0, 0), m_monitoredConfig->data()->screen()->currentSize());
67 + QRect internalOutputRect;
68 +@@ -411,15 +419,6 @@ void KScreenDaemon::alignX11TouchScreen()
69 + break;
70 + }
71 +
72 +- auto *display = XOpenDisplay(nullptr);
73 +- if (!display) {
74 +- return;
75 +- }
76 +- auto *connection = QX11Info::connection();
77 +- if (!connection) {
78 +- return;
79 +- }
80 +-
81 + auto getAtom = [](xcb_connection_t *connection, const char *name) {
82 + auto cookie = xcb_intern_atom(connection, true, strlen(name), name);
83 + auto reply = xcb_intern_atom_reply(connection, cookie, nullptr);
84 +--
85 +GitLab
86 +
87
88 diff --git a/kde-plasma/kscreen/kscreen-5.24.5-r2.ebuild b/kde-plasma/kscreen/kscreen-5.24.5-r2.ebuild
89 new file mode 100644
90 index 000000000000..400f3ae8d7a2
91 --- /dev/null
92 +++ b/kde-plasma/kscreen/kscreen-5.24.5-r2.ebuild
93 @@ -0,0 +1,53 @@
94 +# Copyright 1999-2022 Gentoo Authors
95 +# Distributed under the terms of the GNU General Public License v2
96 +
97 +EAPI=8
98 +
99 +ECM_TEST="forceoptional"
100 +KFMIN=5.90.0
101 +PVCUT=$(ver_cut 1-3)
102 +QTMIN=5.15.2
103 +inherit ecm kde.org
104 +
105 +DESCRIPTION="KDE Plasma screen management"
106 +HOMEPAGE="https://invent.kde.org/plasma/kscreen"
107 +
108 +LICENSE="GPL-2" # TODO: CHECK
109 +SLOT="5"
110 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
111 +IUSE=""
112 +
113 +# bug #580440, last checked 5.6.3
114 +RESTRICT="test"
115 +
116 +DEPEND="
117 + >=dev-qt/qtdbus-${QTMIN}:5
118 + >=dev-qt/qtdeclarative-${QTMIN}:5[widgets]
119 + >=dev-qt/qtgui-${QTMIN}:5
120 + >=dev-qt/qtsensors-${QTMIN}:5
121 + >=dev-qt/qtwidgets-${QTMIN}:5
122 + >=kde-frameworks/kcmutils-${KFMIN}:5
123 + >=kde-frameworks/kconfig-${KFMIN}:5
124 + >=kde-frameworks/kconfigwidgets-${KFMIN}:5
125 + >=kde-frameworks/kcoreaddons-${KFMIN}:5
126 + >=kde-frameworks/kdeclarative-${KFMIN}:5
127 + >=kde-frameworks/kdbusaddons-${KFMIN}:5
128 + >=kde-frameworks/kglobalaccel-${KFMIN}:5
129 + >=kde-frameworks/ki18n-${KFMIN}:5
130 + >=kde-frameworks/kiconthemes-${KFMIN}:5
131 + >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
132 + >=kde-frameworks/kxmlgui-${KFMIN}:5
133 + >=kde-frameworks/plasma-${KFMIN}:5
134 + >=kde-plasma/libkscreen-${PVCUT}:5
135 +"
136 +RDEPEND="${DEPEND}
137 + >=dev-qt/qtgraphicaleffects-${QTMIN}:5
138 + >=kde-plasma/kde-cli-tools-${PVCUT}:5
139 +"
140 +
141 +PATCHES=(
142 + "${FILESDIR}/${P}-kcm-fix-refresh-rate-list-not-updated.patch" # KDE-bug 453392
143 + "${FILESDIR}/${P}-kcm-fix-choosing-refresh-rate.patch"
144 + "${FILESDIR}/${P}-fix-connect-ext-monitors-when-a-monitor-is-rotated.patch"
145 + "${FILESDIR}/${P}-fix-kded-xcb-resources-leak.patch" # KDE-bug 453280
146 +)