[polari] chatView: Don't use child window for cursor changes



commit a818016924f92f0069b50f1c50f862db07972766
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Oct 10 04:48:53 2020 +0200

    chatView: Don't use child window for cursor changes
    
    TextView no longer provides access to individual child windows (surfaces)
    in GTK4. Instead, Gtk.Widget itself has a method for changing the cursor.
    
    Part-of: <https://gitlab.gnome.org/GNOME/polari/-/merge_requests/228>

 src/chatView.js | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index f87b1da6..6c0ec91f 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -447,9 +447,6 @@ export default GObject.registerClass({
         this._roomFocusChangedId = this._app.connect('room-focus-changed',
             this._checkMessages.bind(this));
 
-        this._hoverCursor = Gdk.Cursor.new_from_name(
-            this.get_display(), 'pointer');
-
         this._channelSignals = [];
         this._channel = null;
 
@@ -870,10 +867,8 @@ export default GObject.registerClass({
         let isHovering = hoveredButtonTags.length > 0;
         let wasHovering = this._hoveredButtonTags.length > 0;
 
-        if (isHovering !== wasHovering) {
-            let cursor = isHovering ? this._hoverCursor : null;
-            this._view.get_window(Gtk.TextWindowType.TEXT).set_cursor(cursor);
-        }
+        if (isHovering !== wasHovering)
+            this._view.set_cursor_from_name(isHovering ? 'pointer' : 'text');
 
         this._hoveredButtonTags = hoveredButtonTags;
     }


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