1 |
commit: 9277805e61e6c5580c31cad8d2cfc7de686ce692 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 28 22:04:46 2020 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 29 12:45:27 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9277805e |
7 |
|
8 |
kde-frameworks/kdeclarative: Fix assign Alt-based keyboard shortcuts |
9 |
|
10 |
...which also trigger buttons in the KCM. |
11 |
|
12 |
Upstream commit 88aabf069a0e454777c15227126732a04c8cb8b2 |
13 |
|
14 |
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=425979 |
15 |
Package-Manager: Portage-3.0.8, Repoman-3.0.1 |
16 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
17 |
|
18 |
...ck-shortcuts-when-recording-key-sequences.patch | 104 +++++++++++++++++++++ |
19 |
.../kdeclarative/kdeclarative-5.74.0-r1.ebuild | 39 ++++++++ |
20 |
2 files changed, 143 insertions(+) |
21 |
|
22 |
diff --git a/kde-frameworks/kdeclarative/files/kdeclarative-5.74.0-block-shortcuts-when-recording-key-sequences.patch b/kde-frameworks/kdeclarative/files/kdeclarative-5.74.0-block-shortcuts-when-recording-key-sequences.patch |
23 |
new file mode 100644 |
24 |
index 00000000000..66808f910bf |
25 |
--- /dev/null |
26 |
+++ b/kde-frameworks/kdeclarative/files/kdeclarative-5.74.0-block-shortcuts-when-recording-key-sequences.patch |
27 |
@@ -0,0 +1,104 @@ |
28 |
+From 88aabf069a0e454777c15227126732a04c8cb8b2 Mon Sep 17 00:00:00 2001 |
29 |
+From: David Edmundson <kde@×××××××××××××××××.uk> |
30 |
+Date: Fri, 18 Sep 2020 00:13:07 +0100 |
31 |
+Subject: [PATCH] Block shortcuts when recording key sequences |
32 |
+ |
33 |
+Otherwise you can't select alt+a as a shortcut without triggering the |
34 |
+nmenomic generated shortcut on the "add application" button. |
35 |
+ |
36 |
+Testing done: |
37 |
+- clicked "Add custom shortcut", pressed alt+a, it was recorded |
38 |
+successfully |
39 |
+ |
40 |
+- focussed "Add custom shortcut", pressed alt+a, the relevant shortcut |
41 |
+activated |
42 |
+ |
43 |
+Note that isRecording was already declared, but not defined, which is |
44 |
+why it looks like my diff misses something. |
45 |
+ |
46 |
+BUG: 425979 |
47 |
+--- |
48 |
+ src/qmlcontrols/kquickcontrols/KeySequenceItem.qml | 7 +++++++ |
49 |
+ .../kquickcontrols/private/keysequencehelper.cpp | 8 +++++++- |
50 |
+ .../kquickcontrols/private/keysequencehelper.h | 7 +++++++ |
51 |
+ 3 files changed, 21 insertions(+), 1 deletion(-) |
52 |
+ |
53 |
+diff --git a/src/qmlcontrols/kquickcontrols/KeySequenceItem.qml b/src/qmlcontrols/kquickcontrols/KeySequenceItem.qml |
54 |
+index 9d8e035..d1fbc02 100644 |
55 |
+--- a/src/qmlcontrols/kquickcontrols/KeySequenceItem.qml |
56 |
++++ b/src/qmlcontrols/kquickcontrols/KeySequenceItem.qml |
57 |
+@@ -83,6 +83,13 @@ RowLayout { |
58 |
+ } |
59 |
+ } |
60 |
+ |
61 |
++ Keys.onShortcutOverride: { |
62 |
++ if (_helper.isRecording) { |
63 |
++ _helper.keyPressed(event.key, event.modifiers); |
64 |
++ event.accepted = true; |
65 |
++ } |
66 |
++ } |
67 |
++ |
68 |
+ Keys.onPressed: { |
69 |
+ _helper.keyPressed(event.key, event.modifiers); |
70 |
+ event.accepted = true; |
71 |
+diff --git a/src/qmlcontrols/kquickcontrols/private/keysequencehelper.cpp b/src/qmlcontrols/kquickcontrols/private/keysequencehelper.cpp |
72 |
+index ba7ce01..26b0331 100644 |
73 |
+--- a/src/qmlcontrols/kquickcontrols/private/keysequencehelper.cpp |
74 |
++++ b/src/qmlcontrols/kquickcontrols/private/keysequencehelper.cpp |
75 |
+@@ -237,7 +237,10 @@ void KeySequenceHelper::setCheckAgainstShortcutTypes(KeySequenceHelper::Shortcut |
76 |
+ Q_EMIT checkAgainstShortcutTypesChanged(); |
77 |
+ } |
78 |
+ |
79 |
+- |
80 |
++bool KeySequenceHelper::isRecording() const |
81 |
++{ |
82 |
++ return d->isRecording; |
83 |
++} |
84 |
+ |
85 |
+ void KeySequenceHelper::clearKeySequence() |
86 |
+ { |
87 |
+@@ -251,6 +254,7 @@ void KeySequenceHelperPrivate::startRecording() |
88 |
+ oldKeySequence = keySequence; |
89 |
+ keySequence = QKeySequence(); |
90 |
+ isRecording = true; |
91 |
++ emit q->isRecordingChanged(); |
92 |
+ grabbedWindow = QQuickRenderControl::renderWindowFor(q->window()); |
93 |
+ if (!grabbedWindow) { |
94 |
+ grabbedWindow = q->window(); |
95 |
+@@ -265,6 +269,8 @@ void KeySequenceHelper::doneRecording() |
96 |
+ { |
97 |
+ d->modifierlessTimeout.stop(); |
98 |
+ d->isRecording = false; |
99 |
++ emit isRecordingChanged(); |
100 |
++ |
101 |
+ d->stealActions.clear(); |
102 |
+ if (d->grabbedWindow) { |
103 |
+ d->grabbedWindow->setKeyboardGrabEnabled(false); |
104 |
+diff --git a/src/qmlcontrols/kquickcontrols/private/keysequencehelper.h b/src/qmlcontrols/kquickcontrols/private/keysequencehelper.h |
105 |
+index c9068e8..daeedc5 100644 |
106 |
+--- a/src/qmlcontrols/kquickcontrols/private/keysequencehelper.h |
107 |
++++ b/src/qmlcontrols/kquickcontrols/private/keysequencehelper.h |
108 |
+@@ -51,6 +51,12 @@ class KeySequenceHelper : public QQuickItem |
109 |
+ NOTIFY checkAgainstShortcutTypesChanged |
110 |
+ ) |
111 |
+ |
112 |
++ Q_PROPERTY( |
113 |
++ bool isRecording |
114 |
++ READ isRecording |
115 |
++ NOTIFY isRecordingChanged |
116 |
++ ) |
117 |
++ |
118 |
+ public: |
119 |
+ |
120 |
+ enum ShortcutType { |
121 |
+@@ -116,6 +122,7 @@ Q_SIGNALS: |
122 |
+ void shortcutDisplayChanged(const QString &string); |
123 |
+ void captureFinished(); |
124 |
+ void checkAgainstShortcutTypesChanged(); |
125 |
++ void isRecordingChanged(); |
126 |
+ |
127 |
+ public Q_SLOTS: |
128 |
+ void captureKeySequence(); |
129 |
+-- |
130 |
+GitLab |
131 |
+ |
132 |
|
133 |
diff --git a/kde-frameworks/kdeclarative/kdeclarative-5.74.0-r1.ebuild b/kde-frameworks/kdeclarative/kdeclarative-5.74.0-r1.ebuild |
134 |
new file mode 100644 |
135 |
index 00000000000..6e28a831ed9 |
136 |
--- /dev/null |
137 |
+++ b/kde-frameworks/kdeclarative/kdeclarative-5.74.0-r1.ebuild |
138 |
@@ -0,0 +1,39 @@ |
139 |
+# Copyright 1999-2020 Gentoo Authors |
140 |
+# Distributed under the terms of the GNU General Public License v2 |
141 |
+ |
142 |
+EAPI=7 |
143 |
+ |
144 |
+ECM_TEST="false" |
145 |
+PVCUT=$(ver_cut 1-2) |
146 |
+QTMIN=5.14.2 |
147 |
+inherit ecm kde.org |
148 |
+ |
149 |
+DESCRIPTION="Framework providing integration of QML and KDE work spaces" |
150 |
+LICENSE="LGPL-2+" |
151 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" |
152 |
+IUSE="" |
153 |
+ |
154 |
+# drop qtgui subslot operator when QT_MINIMAL >= 5.15.0 |
155 |
+DEPEND=" |
156 |
+ >=dev-qt/qtdeclarative-${QTMIN}:5 |
157 |
+ >=dev-qt/qtgui-${QTMIN}:5= |
158 |
+ >=dev-qt/qtnetwork-${QTMIN}:5 |
159 |
+ >=dev-qt/qtwidgets-${QTMIN}:5 |
160 |
+ =kde-frameworks/kconfig-${PVCUT}*:5 |
161 |
+ =kde-frameworks/kcoreaddons-${PVCUT}*:5 |
162 |
+ =kde-frameworks/kglobalaccel-${PVCUT}*:5 |
163 |
+ =kde-frameworks/ki18n-${PVCUT}*:5 |
164 |
+ =kde-frameworks/kiconthemes-${PVCUT}*:5 |
165 |
+ =kde-frameworks/kio-${PVCUT}*:5 |
166 |
+ =kde-frameworks/knotifications-${PVCUT}*:5 |
167 |
+ =kde-frameworks/kpackage-${PVCUT}*:5 |
168 |
+ =kde-frameworks/kservice-${PVCUT}*:5 |
169 |
+ =kde-frameworks/kwidgetsaddons-${PVCUT}*:5 |
170 |
+ =kde-frameworks/kwindowsystem-${PVCUT}*:5 |
171 |
+ media-libs/libepoxy |
172 |
+" |
173 |
+RDEPEND="${DEPEND}" |
174 |
+ |
175 |
+PATCHES=( |
176 |
+ "${FILESDIR}"/${P}-block-shortcuts-when-recording-key-sequences.patch |
177 |
+) |