[gnome-music/cherry-pick-51df37f9: 3/3] notificationspopup: Fix source not found warning
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/cherry-pick-51df37f9: 3/3] notificationspopup: Fix source not found warning
- Date: Sun, 8 Apr 2018 13:33:00 +0000 (UTC)
commit cb511a6f194956f892555a66c7e37d6af31a396b
Author: Jean Felder <jfelder src gnome org>
Date: Wed Apr 4 16:27:40 2018 +0200
notificationspopup: Fix source not found warning
If the notification is visible, it means that the timeout is already
finished. In that case, source_remove does not need to be called.
(cherry picked from commit 51df37f9e8f31915eed966f0a0e734abb0c071cb)
gnomemusic/widgets/notificationspopup.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/widgets/notificationspopup.py b/gnomemusic/widgets/notificationspopup.py
index 9aecef65..4861c9dc 100644
--- a/gnomemusic/widgets/notificationspopup.py
+++ b/gnomemusic/widgets/notificationspopup.py
@@ -178,7 +178,8 @@ class LoadingNotification(Gtk.Grid):
if self._counter == 0:
# Stop the timeout if necessary
if self._timeout_id > 0:
- GLib.source_remove(self._timeout_id)
+ if not self.is_visible():
+ GLib.source_remove(self._timeout_id)
self._timeout_id = 0
self.emit('invisible')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]