[gnome-shell/wip/fmuellner/redirect-banners] messageTray: Re-enable unredirection when banner is destroyed



commit c14ee2f5fb7f0cb0f5ab7478ba616934d599b1be
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Nov 22 18:18:34 2018 +0100

    messageTray: Re-enable unredirection when banner is destroyed
    
    The intention of commit 4dc20398 was to disable unredirection while
    banners are shown, but the ::done-displaying signal currently used for
    re-enabling unredirection is only emitted under some circumstances, so
    it's possible that unredirection is left disabled indefinitely, whoops.
    
    Fix this by tying disabling unredirection explicitly to the lifetime
    of the banner actor.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/799

 js/ui/messageTray.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index f8e2f0b9f..9fb0c933a 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1298,14 +1298,16 @@ var MessageTray = new Lang.Class({
         }
 
         this._banner = this._notification.createBanner();
-        this._bannerClickedId = this._banner.connect('done-displaying', () => {
-            Meta.enable_unredirect_for_display(global.display);
-            this._escapeTray();
-        });
+        this._bannerClickedId = this._banner.connect('done-displaying',
+                                                     this._escapeTray.bind(this));
         this._bannerUnfocusedId = this._banner.connect('unfocused', () => {
             this._updateState();
         });
 
+        this._banner.actor.connect('destroy', () => {
+            Meta.enable_unredirect_for_display(global.display);
+        });
+
         this._bannerBin.add_actor(this._banner.actor);
 
         this._bannerBin._opacity = 0;


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