[gnome-shell/gnome-3-34] magnifier: Use new cursor tracker API to keep wayland focus while hidden



commit 9476c9c4cae431e1985f6ea0b768a84e4bf557ca
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Mon Oct 7 15:02:17 2019 +0200

    magnifier: Use new cursor tracker API to keep wayland focus while hidden
    
    Since commit mutter/a2a8f0cda we force the focus surface of the
    meta-wayland-pointer to NULL while the pointer is hidden. This
    introduced an issue with the magnifier, where we use
    `set_pointer_visible` to hide the real cursor and show our own cursor at
    the correct position: Because the meta-wayland-pointer is still used to
    communicate with Wayland clients, the UI of the windows will not respond
    to mouse movement anymore as soon as the real cursor is hidden.
    
    To fix this, use the newly added API of MetaCursorTracker to switch back
    to the old behavior while the magnifier is hiding the system cursor.
    
    In the future and as a more correct fix, we might want to rewrite the
    magnifier so it doesn't have to hide the cursor and can simply show the
    default one (eg. by scaling the actual view instead of a clone of the
    view).
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/754

 js/ui/magnifier.js | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index 0a935edefd..70b12913f3 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -127,6 +127,8 @@ var Magnifier = class Magnifier {
      * Show the system mouse pointer.
      */
     showSystemCursor() {
+        if (this._cursorTracker.set_keep_focus_while_hidden)
+            this._cursorTracker.set_keep_focus_while_hidden(false);
         this._cursorTracker.set_pointer_visible(true);
     }
 
@@ -135,6 +137,8 @@ var Magnifier = class Magnifier {
      * Hide the system mouse pointer.
      */
     hideSystemCursor() {
+        if (this._cursorTracker.set_keep_focus_while_hidden)
+            this._cursorTracker.set_keep_focus_while_hidden(true);
         this._cursorTracker.set_pointer_visible(false);
     }
 


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