[gnome-shell/wip/fmuellner/notification-redux+sass: 63/122] messageTray: Acceptable version of the horrible hack



commit 4472e90eb35dadecceb5b58283fa59746212a021
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Feb 14 15:49:27 2015 +0100

    messageTray: Acceptable version of the horrible hack

 js/ui/messageTray.js |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 75444c6..f30e0e9 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1201,6 +1201,18 @@ const MessageTray = new Lang.Class({
             this._onStatusChanged(status);
         }));
 
+        global.stage.connect('enter-event', Lang.bind(this,
+            function(a, ev) {
+                // HACK: St uses ClutterInputDevice for hover tracking, which
+                // misses relevant X11 events when untracked actors are
+                // involved (read: the notification banner in normal mode),
+                // so fix up Clutter's view of the pointer position in
+                // that case.
+                let related = ev.get_related();
+                if (!related || this.actor.contains(related))
+                    global.sync_pointer();
+            }));
+
         this.actor = new St.Widget({ name: 'notification-container',
                                      clip_to_allocation: true,
                                      x_expand: true, y_expand: true,
@@ -1404,7 +1416,6 @@ const MessageTray = new Lang.Class({
     },
 
     _onNotificationHoverChanged: function() {
-        global.sync_pointer();
         if (this._notificationBin.hover == this._notificationHovered)
             return;
 


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