[gtk+/gtk-2-24] Fix up signal ordering issues in GtkEntry



commit 87e0582f0344e35c30bf9480a2fc3cabe8b22b5d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 25 18:49:54 2011 -0400

    Fix up signal ordering issues in GtkEntry
    
    Ensure that text and selection boundaries are in a
    consistent state when we emit notifications, that ::insert-text
    and ::delete-text are emitted before any changes, and that
    ::changed is emitted after property notifications when inserting
    or deleting text.
    
    Conflicts:
        gtk/gtkentry.c

 gtk/gtkentry.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 1d98673..1921093 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -4581,12 +4581,18 @@ buffer_inserted_text (GtkEntryBuffer *buffer,
                       GtkEntry       *entry)
 {
   guint password_hint_timeout;
+  guint current_pos;
+  gint selection_bound;
+
+  current_pos = entry->current_pos;
+  if (current_pos > position)
+    current_pos += n_chars;
 
-  if (entry->current_pos > position)
-    entry->current_pos += n_chars;
+  selection_bound = entry->selection_bound;
+  if (selection_bound > position)
+    selection_bound += n_chars;
 
-  if (entry->selection_bound > position)
-    entry->selection_bound += n_chars;
+  gtk_entry_set_positions (entry, current_pos, selection_bound);
 
   /* Calculate the password hint if it needs to be displayed. */
   if (n_chars == 1 && !entry->visible)


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