[gtk+] entry: Move freeze/thaw into begin/end_change
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] entry: Move freeze/thaw into begin/end_change
- Date: Fri, 16 Dec 2011 19:11:14 +0000 (UTC)
commit 92a72ce3e5733900ad7560063038899f403c6a9f
Author: Benjamin Otte <otte redhat com>
Date: Sun Nov 6 18:47:28 2011 +0100
entry: Move freeze/thaw into begin/end_change
gtk/gtkentry.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 7769c5a..c2377de 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -2540,6 +2540,8 @@ begin_change (GtkEntry *entry)
GtkEntryPrivate *priv = entry->priv;
priv->change_count++;
+
+ g_object_freeze_notify (G_OBJECT (entry));
}
static void
@@ -2550,6 +2552,8 @@ end_change (GtkEntry *entry)
g_return_if_fail (priv->change_count > 0);
+ g_object_thaw_notify (G_OBJECT (entry));
+
priv->change_count--;
if (priv->change_count == 0)
@@ -4660,11 +4664,9 @@ gtk_entry_real_insert_text (GtkEditable *editable,
* buffer_notify_text(), buffer_notify_length()
*/
begin_change (GTK_ENTRY (editable));
- g_object_freeze_notify (G_OBJECT (editable));
n_inserted = gtk_entry_buffer_insert_text (get_buffer (GTK_ENTRY (editable)), *position, new_text, n_chars);
- g_object_thaw_notify (G_OBJECT (editable));
end_change (GTK_ENTRY (editable));
if (n_inserted != n_chars)
@@ -4685,9 +4687,9 @@ gtk_entry_real_delete_text (GtkEditable *editable,
*/
begin_change (GTK_ENTRY (editable));
- g_object_freeze_notify (G_OBJECT (editable));
+
gtk_entry_buffer_delete_text (get_buffer (GTK_ENTRY (editable)), start_pos, end_pos - start_pos);
- g_object_thaw_notify (G_OBJECT (editable));
+
end_change (GTK_ENTRY (editable));
}
@@ -6484,14 +6486,12 @@ paste_received (GtkClipboard *clipboard,
}
begin_change (entry);
- g_object_freeze_notify (G_OBJECT (entry));
if (gtk_editable_get_selection_bounds (editable, &start, &end))
gtk_editable_delete_text (editable, start, end);
pos = priv->current_pos;
gtk_editable_insert_text (editable, text, length, &pos);
gtk_editable_set_position (editable, pos);
- g_object_thaw_notify (G_OBJECT (entry));
end_change (entry);
if (completion &&
@@ -6848,11 +6848,9 @@ gtk_entry_set_text (GtkEntry *entry,
g_signal_handler_block (entry, completion->priv->changed_id);
begin_change (entry);
- g_object_freeze_notify (G_OBJECT (entry));
gtk_editable_delete_text (GTK_EDITABLE (entry), 0, -1);
tmp_pos = 0;
gtk_editable_insert_text (GTK_EDITABLE (entry), text, strlen (text), &tmp_pos);
- g_object_thaw_notify (G_OBJECT (entry));
end_change (entry);
if (completion && completion->priv->changed_id > 0)
@@ -8998,10 +8996,8 @@ gtk_entry_drag_data_received (GtkWidget *widget,
{
/* Replacing selection */
begin_change (entry);
- g_object_freeze_notify (G_OBJECT (entry));
gtk_editable_delete_text (editable, sel1, sel2);
gtk_editable_insert_text (editable, str, length, &sel1);
- g_object_thaw_notify (G_OBJECT (entry));
end_change (entry);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]