Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/knotifications/files/, kde-frameworks/knotifications/
Date: Wed, 30 Aug 2017 13:13:06
Message-Id: 1504098774.b868d154f825023aa7cab38852336e2c30d6d18e.kensington@gentoo
1 commit: b868d154f825023aa7cab38852336e2c30d6d18e
2 Author: Michael Palimaka <kensington <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 30 13:12:27 2017 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 30 13:12:54 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b868d154
7
8 kde-frameworks/knotifications: backport patch from upstream to resolve notification blocking issue
9
10 Gentoo-bug: 622174
11 Package-Manager: Portage-2.3.6, Repoman-2.3.3
12
13 ...otifications-5.34.0-no-block-notification.patch | 101 +++++++++++++++++++++
14 .../knotifications/knotifications-5.34.0-r1.ebuild | 47 ++++++++++
15 .../knotifications/knotifications-5.37.0-r1.ebuild | 46 ++++++++++
16 3 files changed, 194 insertions(+)
17
18 diff --git a/kde-frameworks/knotifications/files/knotifications-5.34.0-no-block-notification.patch b/kde-frameworks/knotifications/files/knotifications-5.34.0-no-block-notification.patch
19 new file mode 100644
20 index 00000000000..2d1ae95af5f
21 --- /dev/null
22 +++ b/kde-frameworks/knotifications/files/knotifications-5.34.0-no-block-notification.patch
23 @@ -0,0 +1,101 @@
24 +From 1c97e1d9741fd15962474f47932dd09728dae76b Mon Sep 17 00:00:00 2001
25 +From: David Edmundson <kde@×××××××××××××××××.uk>
26 +Date: Fri, 28 Jul 2017 13:04:50 +0100
27 +Subject: [PATCH] Don't block starting notification service
28 +
29 +Summary:
30 +We don't need to manually start the DBus service.
31 +It blocks the calling app, and dbusServiceExists means that we will
32 +always end up going the DBus route over a popup anyway, so it won't
33 +do anything useful.
34 +
35 +The service (in the plasma case plasma-wait-for-name) will be started
36 +automatically when we actually send the notification.
37 +
38 +Also fix d-dbusServiceExists being cleared to false when the first
39 +service owner exits.
40 +
41 +BUG: 382444
42 +
43 +Subscribers: #frameworks
44 +
45 +Tags: #frameworks
46 +
47 +Differential Revision: https://phabricator.kde.org/D6963
48 +---
49 + src/notifybypopup.cpp | 28 +++++++++++-----------------
50 + 1 file changed, 11 insertions(+), 17 deletions(-)
51 +
52 +diff --git a/src/notifybypopup.cpp b/src/notifybypopup.cpp
53 +index 735d52b..4f244e1 100644
54 +--- a/src/notifybypopup.cpp
55 ++++ b/src/notifybypopup.cpp
56 +@@ -109,6 +109,9 @@ public:
57 + * Specifies if DBus Notifications interface exists on session bus
58 + */
59 + bool dbusServiceExists;
60 ++
61 ++ bool dbusServiceActivatable;
62 ++
63 + /**
64 + * DBus notification daemon capabilities cache.
65 + * Do not use this variable. Use #popupServerCapabilities() instead.
66 +@@ -161,6 +164,7 @@ NotifyByPopup::NotifyByPopup(QObject *parent)
67 + {
68 + d->animationTimer = 0;
69 + d->dbusServiceExists = false;
70 ++ d->dbusServiceActivatable = false;
71 + d->dbusServiceCapCacheDirty = true;
72 + d->nextPosition = -1;
73 +
74 +@@ -180,32 +184,20 @@ NotifyByPopup::NotifyByPopup(QObject *parent)
75 + connect(watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)),
76 + SLOT(onServiceOwnerChanged(QString,QString,QString)));
77 +
78 ++#ifndef Q_WS_WIN
79 + if (!d->dbusServiceExists) {
80 +- bool startfdo = false;
81 +-#ifdef Q_WS_WIN
82 +- startfdo = true;
83 +-#else
84 + QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DBus"),
85 + QStringLiteral("/org/freedesktop/DBus"),
86 + QStringLiteral("org.freedesktop.DBus"),
87 + QStringLiteral("ListActivatableNames"));
88 +-
89 +- // FIXME - this should be async
90 + QDBusReply<QStringList> reply = QDBusConnection::sessionBus().call(message);
91 + if (reply.isValid() && reply.value().contains(dbusServiceName)) {
92 +- startfdo = true;
93 +- // We need to set d->dbusServiceExists to true because dbus might be too slow
94 +- // starting the service and the first call to NotifyByPopup::notify
95 +- // might not have had the service up, by setting this to true we
96 +- // guarantee it will still go through dbus and dbus will do the correct
97 +- // thing and wait for the service to go up
98 ++ d->dbusServiceActivatable = true;
99 ++ //if the service is activatable, we can assume it exists even if it is not currently running
100 + d->dbusServiceExists = true;
101 + }
102 +-#endif
103 +- if (startfdo) {
104 +- QDBusConnection::sessionBus().interface()->startService(dbusServiceName);
105 +- }
106 + }
107 ++#endif
108 + }
109 +
110 +
111 +@@ -439,7 +431,9 @@ void NotifyByPopup::onServiceOwnerChanged(const QString &serviceName, const QStr
112 +
113 + if (newOwner.isEmpty()) {
114 + d->notificationQueue.clear();
115 +- d->dbusServiceExists = false;
116 ++ if (!d->dbusServiceActivatable) {
117 ++ d->dbusServiceExists = false;
118 ++ }
119 + } else if (oldOwner.isEmpty()) {
120 + d->dbusServiceExists = true;
121 +
122 +--
123 +2.13.5
124 +
125
126 diff --git a/kde-frameworks/knotifications/knotifications-5.34.0-r1.ebuild b/kde-frameworks/knotifications/knotifications-5.34.0-r1.ebuild
127 new file mode 100644
128 index 00000000000..5947e9e2b6e
129 --- /dev/null
130 +++ b/kde-frameworks/knotifications/knotifications-5.34.0-r1.ebuild
131 @@ -0,0 +1,47 @@
132 +# Copyright 1999-2017 Gentoo Foundation
133 +# Distributed under the terms of the GNU General Public License v2
134 +
135 +EAPI=6
136 +
137 +KDE_TEST="false"
138 +inherit kde5
139 +
140 +DESCRIPTION="Framework for notifying the user of an event"
141 +LICENSE="LGPL-2.1+"
142 +KEYWORDS="~amd64 ~arm ~x86"
143 +IUSE="dbus nls speech X"
144 +
145 +# drop qtgui subslot operator when QT_MINIMAL >= 5.7.0
146 +RDEPEND="
147 + $(add_frameworks_dep kcodecs)
148 + $(add_frameworks_dep kconfig)
149 + $(add_frameworks_dep kcoreaddons)
150 + $(add_frameworks_dep kwindowsystem)
151 + $(add_qt_dep qtdbus)
152 + $(add_qt_dep qtgui '' '' '5=')
153 + $(add_qt_dep qtwidgets)
154 + media-libs/phonon[qt5]
155 + dbus? ( dev-libs/libdbusmenu-qt[qt5] )
156 + speech? ( $(add_qt_dep qtspeech) )
157 + X? (
158 + $(add_qt_dep qtx11extras)
159 + x11-libs/libX11
160 + x11-libs/libXtst
161 + )
162 +"
163 +DEPEND="${RDEPEND}
164 + nls? ( $(add_qt_dep linguist-tools) )
165 + X? ( x11-proto/xproto )
166 +"
167 +
168 +PATCHES=( "${FILESDIR}/${P}-no-block-notification.patch" )
169 +
170 +src_configure() {
171 + local mycmakeargs=(
172 + $(cmake-utils_use_find_package dbus dbusmenu-qt5)
173 + $(cmake-utils_use_find_package speech Qt5TextToSpeech)
174 + $(cmake-utils_use_find_package X X11)
175 + )
176 +
177 + kde5_src_configure
178 +}
179
180 diff --git a/kde-frameworks/knotifications/knotifications-5.37.0-r1.ebuild b/kde-frameworks/knotifications/knotifications-5.37.0-r1.ebuild
181 new file mode 100644
182 index 00000000000..96d9f5e8f93
183 --- /dev/null
184 +++ b/kde-frameworks/knotifications/knotifications-5.37.0-r1.ebuild
185 @@ -0,0 +1,46 @@
186 +# Copyright 1999-2017 Gentoo Foundation
187 +# Distributed under the terms of the GNU General Public License v2
188 +
189 +EAPI=6
190 +
191 +KDE_TEST="false"
192 +inherit kde5
193 +
194 +DESCRIPTION="Framework for notifying the user of an event"
195 +LICENSE="LGPL-2.1+"
196 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
197 +IUSE="dbus nls speech X"
198 +
199 +RDEPEND="
200 + $(add_frameworks_dep kcodecs)
201 + $(add_frameworks_dep kconfig)
202 + $(add_frameworks_dep kcoreaddons)
203 + $(add_frameworks_dep kwindowsystem)
204 + $(add_qt_dep qtdbus)
205 + $(add_qt_dep qtgui)
206 + $(add_qt_dep qtwidgets)
207 + media-libs/phonon[qt5]
208 + dbus? ( dev-libs/libdbusmenu-qt[qt5] )
209 + speech? ( $(add_qt_dep qtspeech) )
210 + X? (
211 + $(add_qt_dep qtx11extras)
212 + x11-libs/libX11
213 + x11-libs/libXtst
214 + )
215 +"
216 +DEPEND="${RDEPEND}
217 + nls? ( $(add_qt_dep linguist-tools) )
218 + X? ( x11-proto/xproto )
219 +"
220 +
221 +PATCHES=( "${FILESDIR}/${PN}-5.34.0-no-block-notification.patch" )
222 +
223 +src_configure() {
224 + local mycmakeargs=(
225 + $(cmake-utils_use_find_package dbus dbusmenu-qt5)
226 + $(cmake-utils_use_find_package speech Qt5TextToSpeech)
227 + $(cmake-utils_use_find_package X X11)
228 + )
229 +
230 + kde5_src_configure
231 +}