[gnome-shell/wip/carlosg/im-dummy-cursor] ibusCandidatePopup: Use an internal actor to track IM focus position



commit 4b54bf1cd9122db808aed03a56073e3f17cd6324
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Oct 8 12:22:34 2019 +0200

    ibusCandidatePopup: Use an internal actor to track IM focus position
    
    We share this actor with other shell menus, which arguably track a different
    "cursor" as we care of the caret/anchor text positions, and menus care about
    pointer click coordinates.
    
    Use a standalone actor for this, so popups/IM are entirely decoupled.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1571

 js/ui/ibusCandidatePopup.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/ibusCandidatePopup.js b/js/ui/ibusCandidatePopup.js
index b9d2092615..9f23f578c0 100644
--- a/js/ui/ibusCandidatePopup.js
+++ b/js/ui/ibusCandidatePopup.js
@@ -126,6 +126,9 @@ Signals.addSignalMethods(CandidateArea.prototype);
 
 var CandidatePopup = class CandidatePopup {
     constructor() {
+        this._dummyCursor = new St.Widget({ opacity: 0 });
+        Main.layoutManager.uiGroup.add_actor(this._dummyCursor);
+
         this._boxPointer = new BoxPointer.BoxPointer(St.Side.TOP);
         this._boxPointer.visible = false;
         this._boxPointer.style_class = 'candidate-popup-boxpointer';
@@ -272,9 +275,11 @@ var CandidatePopup = class CandidatePopup {
     }
 
     _setDummyCursorGeometry(x, y, w, h) {
-        Main.layoutManager.setDummyCursorGeometry(x, y, w, h);
+        this._dummyCursor.set_position(Math.round(x), Math.round(y));
+        this._dummyCursor.set_size(Math.round(w), Math.round(h));
+
         if (this._boxPointer.visible)
-            this._boxPointer.setPosition(Main.layoutManager.dummyCursor, 0);
+            this._boxPointer.setPosition(this._dummyCursor, 0);
     }
 
     _updateVisibility() {
@@ -284,7 +289,7 @@ var CandidatePopup = class CandidatePopup {
                           this._candidateArea.actor.visible));
 
         if (isVisible) {
-            this._boxPointer.setPosition(Main.layoutManager.dummyCursor, 0);
+            this._boxPointer.setPosition(this._dummyCursor, 0);
             this._boxPointer.open(BoxPointer.PopupAnimation.NONE);
             this._boxPointer.raise_top();
         } else {


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