[gnome-music/cherry-pick-51df37f9] notificationspopup: Fix source not found warning



commit e7ab7f6c08b6be2db801e2a27a3e4fd952604e39
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]