[gnome-shell: 120/136] messageTray: Work around glitches with hover tracking



commit d903e831f3ed861a058b5f057ff2aef17e3b76fe
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 13 21:12:53 2015 +0100

    messageTray: Work around glitches with hover tracking
    
    St's hover tracking uses ClutterInputDevice, which unfortunately may use
    an outdated cursor position to determine which actor is hovered. Using
    MetaCursorTracker instead would fix this, but would require linking St with
    libmutter - avoid this for now by manually fixing up Clutter's view of
    the pointer position in the case where we rely on it working properly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744850

 js/ui/messageTray.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 6b19d20..2e400dc 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1369,6 +1369,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',
                                      reactive: true,
                                      track_hover: true,


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