[gnome-shell] notificationDaemon: Focus the new window before destroying the notification



commit 55edfd2e4a4682cad0295b33496b71f2f53549a6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Oct 7 16:11:18 2013 -0400

    notificationDaemon: Focus the new window before destroying the notification
    
    Destroying the notification will make the key focus be reset to NULL, which
    means that gnome-shell will try to focus the MRU window, thinking the user is
    done interacting and wants to go back to whatever they were doing.
    
    Unfortunately, since we focus two windows at the same time, they will have
    the same timestamp, meaning that the window that actually gets focused will
    be a race as to whoever responds to their WM_TAKE_FOCUS event last.
    
    If we explicitly set the focus beforehand, then gnome-shell will believe it
    got key focus taken away from it, and won't try to focus the MRU when the
    key focus drops to NULL.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703265

 js/ui/notificationDaemon.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index de42711..63f03af 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -779,8 +779,8 @@ const Source = new Lang.Class({
     },
 
     open: function(notification) {
-        this.destroyNonResidentNotifications();
         this.openApp();
+        this.destroyNonResidentNotifications();
     },
 
     _lastNotificationRemoved: function() {


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