[gtk+] textview: do not destroy the layout in unrealize
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] textview: do not destroy the layout in unrealize
- Date: Sun, 12 Jun 2011 15:51:43 +0000 (UTC)
commit 391917063eec9571917e3a3e770a56a6e7253822
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sun Jun 12 17:52:23 2011 +0200
textview: do not destroy the layout in unrealize
Now instead of invalidating when we create the layout we invalidate
when we realize the widget and we remove the invalidation when
unrealizing. It was pointless too destroying the layout in unrealize
as at the end what we just wanted was to remove the invalidation idles.
gtk/gtktextview.c | 22 ++--------------------
1 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index b859e0b..be0393b 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -307,7 +307,6 @@ static void gtk_text_view_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_text_view_realize (GtkWidget *widget);
static void gtk_text_view_unrealize (GtkWidget *widget);
-static void gtk_text_view_unmap (GtkWidget *widget);
static void gtk_text_view_style_updated (GtkWidget *widget);
static void gtk_text_view_direction_changed (GtkWidget *widget,
GtkTextDirection previous_direction);
@@ -603,7 +602,6 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
widget_class->destroy = gtk_text_view_destroy;
widget_class->realize = gtk_text_view_realize;
widget_class->unrealize = gtk_text_view_unrealize;
- widget_class->unmap = gtk_text_view_unmap;
widget_class->style_updated = gtk_text_view_style_updated;
widget_class->direction_changed = gtk_text_view_direction_changed;
widget_class->grab_notify = gtk_text_view_grab_notify;
@@ -4029,6 +4027,7 @@ gtk_text_view_realize (GtkWidget *widget)
text_window_realize (priv->bottom_window, widget);
gtk_text_view_ensure_layout (text_view);
+ gtk_text_view_invalidate (text_view);
if (priv->buffer)
{
@@ -4067,8 +4066,7 @@ gtk_text_view_unrealize (GtkWidget *widget)
gtk_text_buffer_remove_selection_clipboard (priv->buffer, clipboard);
}
- /* the idles have been removed in unmap */
- g_assert (priv->first_validate_idle == 0 && priv->incremental_validate_idle == 0);
+ gtk_text_view_remove_validate_idles (text_view);
if (priv->popup_menu)
{
@@ -4090,24 +4088,10 @@ gtk_text_view_unrealize (GtkWidget *widget)
if (priv->bottom_window)
text_window_unrealize (priv->bottom_window);
- gtk_text_view_destroy_layout (text_view);
-
GTK_WIDGET_CLASS (gtk_text_view_parent_class)->unrealize (widget);
}
static void
-gtk_text_view_unmap (GtkWidget *widget)
-{
- GtkTextView *text_view;
-
- text_view = GTK_TEXT_VIEW (widget);
-
- gtk_text_view_remove_validate_idles (text_view);
-
- GTK_WIDGET_CLASS (gtk_text_view_parent_class)->unmap (widget);
-}
-
-static void
gtk_text_view_set_background (GtkTextView *text_view)
{
GtkStyleContext *context;
@@ -6744,8 +6728,6 @@ gtk_text_view_ensure_layout (GtkTextView *text_view)
tmp_list = g_slist_next (tmp_list);
}
-
- gtk_text_view_invalidate (text_view);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]