[gnome-shell] main: move pointer-sync-on-restack code here



commit d5f37fa28037f68c1fca218b24a7dd82d6b0a4fc
Author: Dan Winship <danw gnome org>
Date:   Fri Jun 10 09:51:55 2011 -0400

    main: move pointer-sync-on-restack code here
    
    We call global.sync_pointer() on MetaScreen::restack as a hack to try
    to fix up the hover state after a pointer grab. Previously we were
    doing this in chrome.js, since there was already a ::restack handler
    there anyway, but this isn't really related to the chrome at all, so
    move it to main.js instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=633620

 js/ui/chrome.js |    5 -----
 js/ui/main.js   |    8 ++++++++
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/chrome.js b/js/ui/chrome.js
index 27779fc..32b8f04 100644
--- a/js/ui/chrome.js
+++ b/js/ui/chrome.js
@@ -335,11 +335,6 @@ Chrome.prototype = {
             this._updateVisibility();
             this._queueUpdateRegions();
         }
-
-        // Figure out where the pointer is in case we lost track of
-        // it during a grab. (In particular, if a trayicon popup menu
-        // is dismissed, see if we need to close the message tray.)
-        global.sync_pointer();
     },
 
     _updateRegions: function() {
diff --git a/js/ui/main.js b/js/ui/main.js
index c0f4845..43fcfa5 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -208,6 +208,7 @@ function start() {
 
     global.screen.connect('window-entered-monitor', _windowEnteredMonitor);
     global.screen.connect('window-left-monitor', _windowLeftMonitor);
+    global.screen.connect('restacked', _windowsRestacked);
 
     _nWorkspacesChanged();
 }
@@ -310,6 +311,13 @@ function _windowEnteredMonitor(metaScreen, monitorIndex, metaWin) {
         _queueCheckWorkspaces();
 }
 
+function _windowsRestacked() {
+    // Figure out where the pointer is in case we lost track of
+    // it during a grab. (In particular, if a trayicon popup menu
+    // is dismissed, see if we need to close the message tray.)
+    global.sync_pointer();
+}
+
 function _queueCheckWorkspaces() {
     if (_checkWorkspacesId == 0)
         _checkWorkspacesId = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, _checkWorkspaces);



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