[gnome-shell/wip/carlosg/im-full-reset: 2/5] inputMethod: Cache cursor rectangle




commit 278b7ab660ab72d466614a76006eee66837fa2d1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Oct 17 13:30:40 2022 +0200

    inputMethod: Cache cursor rectangle
    
    This may need to be synchronized in other places, so keep
    the rectangle around.

 js/misc/inputMethod.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js
index cb70f93f7a..054096589a 100644
--- a/js/misc/inputMethod.js
+++ b/js/misc/inputMethod.js
@@ -215,8 +215,13 @@ var InputMethod = GObject.registerClass({
 
     vfunc_set_cursor_location(rect) {
         if (this._context) {
-            this._context.set_cursor_location(rect.get_x(), rect.get_y(),
-                                              rect.get_width(), rect.get_height());
+            this._cursorRect = {
+                x: rect.get_x(), y: rect.get_y(),
+                width: rect.get_width(), height: rect.get_height(),
+            };
+            this._context.set_cursor_location(
+                this._cursorRect.x, this._cursorRect.y,
+                this._cursorRect.width, this._cursorRect.height);
             this._emitRequestSurrounding();
         }
     }


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