[gnome-shell] magnifier: Use inhibit-unfocus API to keep wayland focus while hidden



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

    magnifier: Use inhibit-unfocus 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 clutter_seat_inhibit_unfocus() API to
    temporarily disable unsetting the focus-surface while the magnifier is
    hiding the system cursor.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/993

 js/ui/magnifier.js | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index 8e149a130e..1c935b9c93 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -127,6 +127,10 @@ var Magnifier = class Magnifier {
      * Show the system mouse pointer.
      */
     showSystemCursor() {
+        const seat = Clutter.get_default_backend().get_default_seat();
+
+        if (seat.is_unfocus_inhibited())
+            seat.uninhibit_unfocus();
         this._cursorTracker.set_pointer_visible(true);
     }
 
@@ -135,6 +139,10 @@ var Magnifier = class Magnifier {
      * Hide the system mouse pointer.
      */
     hideSystemCursor() {
+        const seat = Clutter.get_default_backend().get_default_seat();
+
+        if (!seat.is_unfocus_inhibited())
+            seat.inhibit_unfocus();
         this._cursorTracker.set_pointer_visible(false);
     }
 


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