[SCM] knotifications packaging branch, master, updated. debian/5.26.0-2-6-ged004c9

Maximiliano Curia maxy at moszumanska.debian.org
Sat Oct 15 22:03:24 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/frameworks/knotifications.git;a=commitdiff;h=98527bb

The following commit has been merged in the master branch:
commit 98527bb9f1a7bd9c113fb0f458b8a03514ded656
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date:   Sat Oct 15 11:51:56 2016 +0200

    Add upstream patches
    
    Gbp-Dch: Ignore
---
 debian/changelog                                   |  7 ++
 ...bject-we-haven-t-referenced-when-notifica.patch | 47 +++++++++++
 debian/patches/Fix-crashes-in-NotifyByAudio.patch  | 93 ++++++++++++++++++++++
 ...on-t-use-KPassivePopup-without-QApplicati.patch | 39 +++++++++
 debian/patches/series                              |  3 +
 5 files changed, 189 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 60e4d79..81abcb0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,8 +2,15 @@ knotifications (5.27.0-1~1.gbp4592f2) UNRELEASED; urgency=medium
 
   ** SNAPSHOT build @4592f25037c6dcd5b0b78700d8cd01c9eb872bf1 **
 
+  [ Automatic packaging ]
   * Update build-deps and deps with the info from cmake
 
+  [ Maximiliano Curia ]
+  * Add upstream patches:
+     - Don-t-deref-an-object-we-haven-t-referenced-when-notifica.patch
+     - Fix-crashes-in-NotifyByAudio.patch
+     - KNotifications-Don-t-use-KPassivePopup-without-QApplicati.patch
+
  -- Automatic packaging <maxy+jenkins at gnuservers.com.ar>  Sat, 08 Oct 2016 14:14:54 +0200
 
 knotifications (5.26.0-2) unstable; urgency=medium
diff --git a/debian/patches/Don-t-deref-an-object-we-haven-t-referenced-when-notifica.patch b/debian/patches/Don-t-deref-an-object-we-haven-t-referenced-when-notifica.patch
new file mode 100644
index 0000000..59687d0
--- /dev/null
+++ b/debian/patches/Don-t-deref-an-object-we-haven-t-referenced-when-notifica.patch
@@ -0,0 +1,47 @@
+From: David Edmundson <kde at davidedmundson.co.uk>
+Date: Tue, 11 Oct 2016 12:17:18 +0100
+Subject: Don't deref an object we haven't referenced when notification has no
+ action
+
+KNotificatitionManager::self() has an early check if a notification has
+no actions. If it has no actions it tries to close the notification
+early. However it's dereferencing an object that it has not referenced,
+sending the ref count to -1, a corrupt state that is not handled
+gracefully in KNotification, and we don't ever close the notification.
+
+By referencing and dereferencing we're still calling the cleanup in
+KNotification (if applicable) but without sending a ref count negative.
+
+This fixes ksmserver waiting for the logout sound to play; which
+currently never emits close, as the default setup has no logout sound.
+
+REVIEW: 129146
+---
+ src/knotification.cpp        | 1 +
+ src/knotificationmanager.cpp | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/knotification.cpp b/src/knotification.cpp
+index 352cf49..b14fa44 100644
+--- a/src/knotification.cpp
++++ b/src/knotification.cpp
+@@ -375,6 +375,7 @@ void KNotification::ref()
+ }
+ void KNotification::deref()
+ {
++    Q_ASSERT(d->ref > 0);
+     d->ref--;
+     if (d->ref == 0) {
+         d->id = -1;
+diff --git a/src/knotificationmanager.cpp b/src/knotificationmanager.cpp
+index c315db9..cd44ca7 100644
+--- a/src/knotificationmanager.cpp
++++ b/src/knotificationmanager.cpp
+@@ -199,6 +199,7 @@ int KNotificationManager::notify(KNotification *n)
+ 
+     if (notifyActions.isEmpty() || notifyActions == QLatin1String("None")) {
+         // this will cause KNotification closing itself fast
++        n->ref();
+         n->deref();
+         return -1;
+     }
diff --git a/debian/patches/Fix-crashes-in-NotifyByAudio.patch b/debian/patches/Fix-crashes-in-NotifyByAudio.patch
new file mode 100644
index 0000000..95c0f96
--- /dev/null
+++ b/debian/patches/Fix-crashes-in-NotifyByAudio.patch
@@ -0,0 +1,93 @@
+From: Albert Astals Cid <aacid at kde.org>
+Date: Tue, 4 Oct 2016 23:25:49 +0200
+Subject: Fix crashes in NotifyByAudio
+
+Phonon::MediaObject::stop does not emit finished and thus onAudioFinished is not called and thus finished() was not called and then when closing the app, the notification manager would go and delete all the non finished notifications, meaning it would call close() again, add the same Phonon::MediaObject to m_reusablePhonons again and then crash because it would delete them twice in the destructor
+
+Testing Done:
+  configure konsole notifications to emit sound on "Bell in Visible Session" and also show an info box.
+  make it bell and quickly close the info box.
+  close konsole.
+  without this patch it will crash.
+
+REVIEw: 129092
+---
+ src/notifybyaudio.cpp | 30 +++++++++++++++++++-----------
+ src/notifybyaudio.h   |  2 ++
+ 2 files changed, 21 insertions(+), 11 deletions(-)
+
+diff --git a/src/notifybyaudio.cpp b/src/notifybyaudio.cpp
+index 903e996..7c5f06b 100644
+--- a/src/notifybyaudio.cpp
++++ b/src/notifybyaudio.cpp
+@@ -111,6 +111,7 @@ void NotifyByAudio::notify(KNotification *notification, KNotifyConfig *config)
+         connect(m, SIGNAL(currentSourceChanged(Phonon::MediaSource)), SLOT(onAudioSourceChanged(Phonon::MediaSource)));
+     }
+ 
++    Q_ASSERT(!m_notifications.value(m));
+     m_notifications.insert(m, notification);
+ }
+ 
+@@ -127,9 +128,8 @@ void NotifyByAudio::close(KNotification *notification)
+         return;
+     }
+ 
+-    // this should call onAudioFinished() which also does finish() on the notification
+     m->stop();
+-    m_reusablePhonons.append(m);
++    finishNotification(notification, m);
+ }
+ 
+ void NotifyByAudio::onAudioFinished()
+@@ -140,21 +140,29 @@ void NotifyByAudio::onAudioFinished()
+         return;
+     }
+ 
+-    if (KNotification *notification = m_notifications.value(m, nullptr)) {
+-        //if the sound is short enough, we can't guarantee new sounds are
+-        //enqueued before finished is emitted.
+-        //so to make sure we are looping restart it when the sound finished
+-        if (notification->flags() & KNotification::LoopSound) {
+-            m->play();
+-            return;
+-        }
++    KNotification *notification = m_notifications.value(m, nullptr);
++
++    //if the sound is short enough, we can't guarantee new sounds are
++    //enqueued before finished is emitted.
++    //so to make sure we are looping restart it when the sound finished
++    if (notification && (notification->flags() & KNotification::LoopSound)) {
++        m->play();
++        return;
++    }
+ 
++    finishNotification(notification, m);
++}
++
++void NotifyByAudio::finishNotification(KNotification *notification, Phonon::MediaObject *m)
++{
++    m_notifications.remove(m);
++
++    if (notification) {
+         finish(notification);
+     }
+ 
+     disconnect(m, SIGNAL(currentSourceChanged(Phonon::MediaSource)), this, SLOT(onAudioSourceChanged(Phonon::MediaSource)));
+ 
+-    m_notifications.remove(m);
+     m_reusablePhonons.append(m);
+ }
+ 
+diff --git a/src/notifybyaudio.h b/src/notifybyaudio.h
+index 6726a93..676b6e3 100644
+--- a/src/notifybyaudio.h
++++ b/src/notifybyaudio.h
+@@ -54,6 +54,8 @@ private Q_SLOTS:
+ 
+ 
+ private:
++    void finishNotification(KNotification *notification, Phonon::MediaObject *m);
++
+     QList<Phonon::MediaObject*> m_reusablePhonons;
+     QHash<Phonon::MediaObject*, KNotification*> m_notifications;
+     Phonon::AudioOutput *m_audioOutput;
diff --git a/debian/patches/KNotifications-Don-t-use-KPassivePopup-without-QApplicati.patch b/debian/patches/KNotifications-Don-t-use-KPassivePopup-without-QApplicati.patch
new file mode 100644
index 0000000..c96d7b5
--- /dev/null
+++ b/debian/patches/KNotifications-Don-t-use-KPassivePopup-without-QApplicati.patch
@@ -0,0 +1,39 @@
+From: Kai Uwe Broulik <kde at privat.broulik.de>
+Date: Fri, 14 Oct 2016 09:29:50 +0200
+Subject: [KNotifications] Don't use KPassivePopup without QApplication
+
+When using KNotification from a QGuiApplication and there is no notification service present,
+the application will assert.
+
+CHANGELOG: KNotification will no longer crash when using it in a QGuiApplication and no notification service is running
+
+BUG: 370667
+REVIEW: 129177
+---
+ src/notifybypopup.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/notifybypopup.cpp b/src/notifybypopup.cpp
+index 7d69a36..fe948ce 100644
+--- a/src/notifybypopup.cpp
++++ b/src/notifybypopup.cpp
+@@ -30,6 +30,7 @@
+ #include "knotification.h"
+ #include "debug_p.h"
+ 
++#include <QApplication>
+ #include <QBuffer>
+ #include <QImage>
+ #include <QLabel>
+@@ -284,6 +285,11 @@ void NotifyByPopup::notify(KNotification *notification, const KNotifyConfig &not
+         return;
+     }
+ 
++    if (!qobject_cast<QApplication *>(QCoreApplication::instance())) {
++        qCWarning(LOG_KNOTIFICATIONS) << "KNotification did not detect any running org.freedesktop.Notifications server and fallback notifications cannot be used without a QApplication!";
++        return;
++    }
++
+     // last fallback - display the popup using KPassivePopup
+     KPassivePopup *pop = new KPassivePopup(notification->widget());
+     d->passivePopups.insert(notification, pop);
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..943779a
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+Fix-crashes-in-NotifyByAudio.patch
+KNotifications-Don-t-use-KPassivePopup-without-QApplicati.patch
+Don-t-deref-an-object-we-haven-t-referenced-when-notifica.patch

-- 
knotifications packaging



More information about the pkg-kde-commits mailing list