1 |
commit: be8d5d31fabe30019827aba39e50153a58a3f395 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 29 19:35:11 2022 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 29 19:53:17 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be8d5d31 |
7 |
|
8 |
kde-frameworks/kglobalaccel: Fix D-Bus de/marshalling MatchType |
9 |
|
10 |
Upstream commit 1a8e8cb00cda5807926a90ae8e5d5597354f3541 |
11 |
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=454704 |
12 |
|
13 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
|
16 |
...accel-5.95.0-fix-shortcut-conflict-dialog.patch | 151 +++++++++++++++++++++ |
17 |
.../kglobalaccel/kglobalaccel-5.95.0-r1.ebuild | 46 +++++++ |
18 |
2 files changed, 197 insertions(+) |
19 |
|
20 |
diff --git a/kde-frameworks/kglobalaccel/files/kglobalaccel-5.95.0-fix-shortcut-conflict-dialog.patch b/kde-frameworks/kglobalaccel/files/kglobalaccel-5.95.0-fix-shortcut-conflict-dialog.patch |
21 |
new file mode 100644 |
22 |
index 000000000000..c39f30d86d3c |
23 |
--- /dev/null |
24 |
+++ b/kde-frameworks/kglobalaccel/files/kglobalaccel-5.95.0-fix-shortcut-conflict-dialog.patch |
25 |
@@ -0,0 +1,151 @@ |
26 |
+From 1a8e8cb00cda5807926a90ae8e5d5597354f3541 Mon Sep 17 00:00:00 2001 |
27 |
+From: Ahmad Samir <a.samirh78@×××××.com> |
28 |
+Date: Sat, 4 Jun 2022 23:00:15 +0200 |
29 |
+Subject: [PATCH] Fix D-Bus de/marshalling KGlobalAccel::MatchType |
30 |
+ |
31 |
+Otherwise the globalShortcutsByKey() method is silently skipped, and isn't |
32 |
+visible on the org.kde.KGlobalAccel D-Bus interface. |
33 |
+ |
34 |
+It turns out that to test changes made in kglobalaccel d-bus interface, you |
35 |
+need to kill the system /usr/bin/kglobalaccel process (be careful as that |
36 |
+breaks the most basic shortcuts, e.g. Alt+Tab), and run the one from the |
37 |
+build-dir, otherwise the session d-bus won't pick up your changes. |
38 |
+ |
39 |
+To test: |
40 |
+- List all methods on the interface: |
41 |
+ `qdbus org.kde.kglobalaccel /kglobalaccel` |
42 |
+- The followin messages are printed in the system log/journal: |
43 |
+Skipped method "globalShortcutsByKey" : Unregistered input type in parameter list: KGlobalAccel::MatchType |
44 |
+Skipped method "globalShortcutsByKey" : Unregistered input type in parameter list: KGlobalAccel::MatchType |
45 |
+ |
46 |
+To see the behaviour mentioned in the bug report: |
47 |
+- Create a global shortcut of some kind (e.g. F4 to start some app) |
48 |
+- open the shortcut editor in e.g. Dolphin, and try to assign that same |
49 |
+ shortcut to some other action the conflict shortcut message dialog should |
50 |
+ show a message similar to the one in the attached screenshot at: |
51 |
+ https://bugs.kde.org/show_bug.cgi?id=454704#c0 |
52 |
+The list of GlobalShortcutInfo returned by globalShortcutsByKey() is empty |
53 |
+because the method couldn't be found on the d-bus interface. |
54 |
+ |
55 |
+After applying patch: |
56 |
+- kill the system /usr/bin/kglobalaccel and start the one from the build |
57 |
+ dir |
58 |
+- Start Dolphin with the libs from the build-dir e.g.: |
59 |
+ LD_LIBRARY_PATH=build-dir/bin/ dolphin |
60 |
+- The info about the global shortcut should be shown in the message dialog |
61 |
+ |
62 |
+BUG: 454704 |
63 |
+FIXED-IN: 5.95 |
64 |
+--- |
65 |
+ src/kglobalaccel.cpp | 19 +++++++++++++++++++ |
66 |
+ src/kglobalaccel.h | 3 +++ |
67 |
+ src/kglobalshortcutinfo_p.h | 1 + |
68 |
+ src/org.kde.KGlobalAccel.xml | 3 ++- |
69 |
+ src/runtime/kglobalacceld.cpp | 4 ++-- |
70 |
+ 5 files changed, 27 insertions(+), 3 deletions(-) |
71 |
+ |
72 |
+diff --git a/src/kglobalaccel.cpp b/src/kglobalaccel.cpp |
73 |
+index d0d2932..ef51b56 100644 |
74 |
+--- a/src/kglobalaccel.cpp |
75 |
++++ b/src/kglobalaccel.cpp |
76 |
+@@ -147,6 +147,7 @@ KGlobalAccel::KGlobalAccel() |
77 |
+ qDBusRegisterMetaType<QList<QStringList>>(); |
78 |
+ qDBusRegisterMetaType<KGlobalShortcutInfo>(); |
79 |
+ qDBusRegisterMetaType<QList<KGlobalShortcutInfo>>(); |
80 |
++ qDBusRegisterMetaType<KGlobalAccel::MatchType>(); |
81 |
+ } |
82 |
+ |
83 |
+ KGlobalAccel::~KGlobalAccel() |
84 |
+@@ -785,4 +786,22 @@ bool KGlobalAccelPrivate::setShortcutWithDefault(QAction *action, const QList<QK |
85 |
+ return true; |
86 |
+ } |
87 |
+ |
88 |
++QDBusArgument &operator<<(QDBusArgument &argument, const KGlobalAccel::MatchType &type) |
89 |
++{ |
90 |
++ argument.beginStructure(); |
91 |
++ argument << static_cast<int>(type); |
92 |
++ argument.endStructure(); |
93 |
++ return argument; |
94 |
++} |
95 |
++ |
96 |
++const QDBusArgument &operator>>(const QDBusArgument &argument, KGlobalAccel::MatchType &type) |
97 |
++{ |
98 |
++ argument.beginStructure(); |
99 |
++ int arg; |
100 |
++ argument >> arg; |
101 |
++ type = static_cast<KGlobalAccel::MatchType>(arg); |
102 |
++ argument.endStructure(); |
103 |
++ return argument; |
104 |
++} |
105 |
++ |
106 |
+ #include "moc_kglobalaccel.cpp" |
107 |
+diff --git a/src/kglobalaccel.h b/src/kglobalaccel.h |
108 |
+index 563278b..a74a311 100644 |
109 |
+--- a/src/kglobalaccel.h |
110 |
++++ b/src/kglobalaccel.h |
111 |
+@@ -400,4 +400,7 @@ private: |
112 |
+ friend class KGlobalAccelSingleton; |
113 |
+ }; |
114 |
+ |
115 |
++KGLOBALACCEL_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const KGlobalAccel::MatchType &type); |
116 |
++KGLOBALACCEL_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, KGlobalAccel::MatchType &type); |
117 |
++ |
118 |
+ #endif // _KGLOBALACCEL_H_ |
119 |
+diff --git a/src/kglobalshortcutinfo_p.h b/src/kglobalshortcutinfo_p.h |
120 |
+index 4b9146f..b3fa620 100644 |
121 |
+--- a/src/kglobalshortcutinfo_p.h |
122 |
++++ b/src/kglobalshortcutinfo_p.h |
123 |
+@@ -13,6 +13,7 @@ |
124 |
+ |
125 |
+ static const int maxSequenceLength = 4; |
126 |
+ |
127 |
++#include "kglobalaccel.h" |
128 |
+ #include "kglobalshortcutinfo.h" |
129 |
+ |
130 |
+ class KGlobalShortcutInfoPrivate |
131 |
+diff --git a/src/org.kde.KGlobalAccel.xml b/src/org.kde.KGlobalAccel.xml |
132 |
+index 65f93b8..d48ce87 100644 |
133 |
+--- a/src/org.kde.KGlobalAccel.xml |
134 |
++++ b/src/org.kde.KGlobalAccel.xml |
135 |
+@@ -121,7 +121,8 @@ |
136 |
+ <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<KGlobalShortcutInfo>"/> |
137 |
+ <arg name="key" type="ai" direction="in"/> |
138 |
+ <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QKeySequence"/> |
139 |
+- <arg name="type" type="i" direction="in"/> |
140 |
++ <arg name="matchType" type="KGlobalAccel::MatchType" direction="in"/> |
141 |
++ <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="KGlobalAccel::MatchType"/> |
142 |
+ </method> |
143 |
+ <method name="globalShortcutAvailable"> |
144 |
+ <arg type="b" direction="out"/> |
145 |
+diff --git a/src/runtime/kglobalacceld.cpp b/src/runtime/kglobalacceld.cpp |
146 |
+index cf22d26..e14d419 100644 |
147 |
+--- a/src/runtime/kglobalacceld.cpp |
148 |
++++ b/src/runtime/kglobalacceld.cpp |
149 |
+@@ -13,6 +13,7 @@ |
150 |
+ #include "globalshortcut.h" |
151 |
+ #include "globalshortcutcontext.h" |
152 |
+ #include "globalshortcutsregistry.h" |
153 |
++#include "kglobalaccel.h" |
154 |
+ #include "kserviceactioncomponent.h" |
155 |
+ #include "logging_p.h" |
156 |
+ |
157 |
+@@ -21,8 +22,6 @@ |
158 |
+ #include <QMetaMethod> |
159 |
+ #include <QTimer> |
160 |
+ |
161 |
+-#include "kglobalaccel.h" |
162 |
+- |
163 |
+ struct KGlobalAccelDPrivate { |
164 |
+ KGlobalAccelDPrivate(KGlobalAccelD *qq) |
165 |
+ : q(qq) |
166 |
+@@ -175,6 +174,7 @@ bool KGlobalAccelD::init() |
167 |
+ qDBusRegisterMetaType<QStringList>(); |
168 |
+ qDBusRegisterMetaType<KGlobalShortcutInfo>(); |
169 |
+ qDBusRegisterMetaType<QList<KGlobalShortcutInfo>>(); |
170 |
++ qDBusRegisterMetaType<KGlobalAccel::MatchType>(); |
171 |
+ |
172 |
+ GlobalShortcutsRegistry *reg = GlobalShortcutsRegistry::self(); |
173 |
+ Q_ASSERT(reg); |
174 |
+-- |
175 |
+GitLab |
176 |
+ |
177 |
|
178 |
diff --git a/kde-frameworks/kglobalaccel/kglobalaccel-5.95.0-r1.ebuild b/kde-frameworks/kglobalaccel/kglobalaccel-5.95.0-r1.ebuild |
179 |
new file mode 100644 |
180 |
index 000000000000..28733db44c48 |
181 |
--- /dev/null |
182 |
+++ b/kde-frameworks/kglobalaccel/kglobalaccel-5.95.0-r1.ebuild |
183 |
@@ -0,0 +1,46 @@ |
184 |
+# Copyright 1999-2022 Gentoo Authors |
185 |
+# Distributed under the terms of the GNU General Public License v2 |
186 |
+ |
187 |
+EAPI=8 |
188 |
+ |
189 |
+PVCUT=$(ver_cut 1-2) |
190 |
+QTMIN=5.15.3 |
191 |
+VIRTUALX_REQUIRED="test" |
192 |
+inherit ecm kde.org |
193 |
+ |
194 |
+DESCRIPTION="Framework to handle global shortcuts" |
195 |
+ |
196 |
+LICENSE="LGPL-2+" |
197 |
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86" |
198 |
+IUSE="nls" |
199 |
+ |
200 |
+# requires installed instance |
201 |
+RESTRICT="test" |
202 |
+ |
203 |
+RDEPEND=" |
204 |
+ >=dev-qt/qtdbus-${QTMIN}:5 |
205 |
+ >=dev-qt/qtgui-${QTMIN}:5 |
206 |
+ >=dev-qt/qtwidgets-${QTMIN}:5 |
207 |
+ >=dev-qt/qtx11extras-${QTMIN}:5 |
208 |
+ =kde-frameworks/kconfig-${PVCUT}*:5 |
209 |
+ =kde-frameworks/kcoreaddons-${PVCUT}*:5 |
210 |
+ =kde-frameworks/kcrash-${PVCUT}*:5 |
211 |
+ =kde-frameworks/kdbusaddons-${PVCUT}*:5 |
212 |
+ =kde-frameworks/kwindowsystem-${PVCUT}*:5[X] |
213 |
+ x11-libs/libxcb |
214 |
+ x11-libs/xcb-util-keysyms |
215 |
+" |
216 |
+DEPEND="${RDEPEND} |
217 |
+ test? ( |
218 |
+ >=dev-qt/qtdeclarative-${QTMIN}:5 |
219 |
+ >=dev-qt/qtquickcontrols2-${QTMIN}:5 |
220 |
+ =kde-frameworks/kdeclarative-${PVCUT}*:5 |
221 |
+ ) |
222 |
+" |
223 |
+BDEPEND="nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )" |
224 |
+ |
225 |
+PATCHES=( "${FILESDIR}/${P}-fix-shortcut-conflict-dialog.patch" ) |
226 |
+ |
227 |
+src_test() { |
228 |
+ XDG_CURRENT_DESKTOP="KDE" ecm_src_test # bug 789342 |
229 |
+} |