[gnome-shell] Telepathy: hide chat notifications when focusing the app



commit d8926b96e28fb23ace76d207f765cb2ad48b7096
Author: Giovanni Campagna <gcampagna gnome org>
Date:   Tue Mar 17 13:08:05 2015 -0700

    Telepathy: hide chat notifications when focusing the app
    
    When the chat app is focused, we should hide all banners immediately.
    A good way to do so, without tracking which app is focused, is
    to look for messages that are acked when the banner is unexpanded,
    which implies they were acked by some other telepathy client.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746364

 js/ui/components/telepathyClient.js |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js
index ba2f3b4..38b5347 100644
--- a/js/ui/components/telepathyClient.js
+++ b/js/ui/components/telepathyClient.js
@@ -577,6 +577,10 @@ const ChatSource = new Lang.Class({
             this._pendingMessages.splice(idx, 1);
             this.countUpdated();
         }
+
+        if (this._pendingMessages.length == 0 &&
+            this._banner && !this._banner.expanded)
+            this._banner.hide();
     },
 
     _ackMessages: function() {
@@ -830,6 +834,10 @@ const ChatNotificationBanner = new Lang.Class({
             adjustment.value = adjustment.upper;
     },
 
+    hide: function() {
+        this.emit('done-displaying');
+    },
+
     _addMessage: function(message) {
         let highlighter = new Calendar.URLHighlighter(message.body, true, true);
         let body = highlighter.actor;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]