[gnome-shell] MessageTray: escape the tray when a legacy icon is clicked



commit eb351b18825b7eb0ee29716f444df9eb2b6d3a44
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Fri Aug 31 18:43:00 2012 +0200

    MessageTray: escape the tray when a legacy icon is clicked
    
    Legacy tray icons may want to take a pointer grab to show a popup menu,
    and this is incompatible with message tray modality. To solve this,
    escape the tray when forwarding clicks to the tray icons, and wait
    for the input mode change to actually synthetize the X event.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682244

 js/ui/messageTray.js        |    2 +-
 js/ui/notificationDaemon.js |   16 +++++-----------
 2 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 7ada616..a382c79 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1740,7 +1740,7 @@ const MessageTray = new Lang.Class({
 
     _onSummaryItemClicked: function(summaryItem, button) {
         if (summaryItem.source.handleSummaryClick()) {
-            this._setClickedSummaryItem(null);
+            this._escapeTray();
         } else {
             if (!this._setClickedSummaryItem(summaryItem, button))
                 this._setClickedSummaryItem(null);
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index fb580fe..5b41197 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -583,18 +583,12 @@ const Source = new Lang.Class({
             this.notifications.length > 0)
             return false;
 
-        if (Main.overview.visible) {
-            // We can't just connect to Main.overview's 'hidden' signal,
-            // because it's emitted *before* it calls popModal()...
-            let id = global.connect('notify::stage-input-mode', Lang.bind(this,
-                function () {
-                    global.disconnect(id);
-                    this.trayIcon.click(event);
-                }));
-            Main.overview.hide();
-        } else {
+        let id = global.connect('notify::stage-input-mode', Lang.bind(this, function () {
+            global.disconnect(id);
             this.trayIcon.click(event);
-        }
+        }));
+
+        Main.overview.hide();
         return true;
     },
 



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