[gnome-shell] st/entry: Notify "text" prop on every change in the ClutterText



commit c2956e8bd2de01de4fdfc6e8a8eb41ef2df91134
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Thu Jan 23 19:09:50 2020 +0100

    st/entry: Notify "text" prop on every change in the ClutterText
    
    Notifying the "text" property inside `st_entry_set_text()` misses all
    the text changes done by ClutterText itself, including those that happen
    on key-presses. Fix that by notifying that property inside the
    "notify::text" handler connected to the ClutterText.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/951

 src/st/st-entry.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index ba3d1ca603..24fe7434c7 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -542,6 +542,8 @@ clutter_text_changed_cb (GObject    *object,
 
   /* Since the text changed, force a regen of the shadow texture */
   cogl_clear_object (&priv->text_shadow_material);
+
+  g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_TEXT]);
 }
 
 static void
@@ -1054,7 +1056,8 @@ st_entry_set_text (StEntry     *entry,
 
   clutter_text_set_text (CLUTTER_TEXT (priv->entry), text);
 
-  g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_TEXT]);
+  /* Note: PROP_TEXT will get notfied from our notify::text handler connected
+   * to priv->entry. */
 }
 
 /**


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