[gnome-shell/wip/fmuellner/notification-redux: 67/88] messageTray: Acceptable version of the horrible hack



commit d0a72d4ec00f13039ef43fef748e3b222ed8476c
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 2e9b5a9..34a43e8 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]