[gedit] Only activate ViewActivatable once



commit 87389723355dd43f4759a0e80c754bfaf694a368
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Wed Apr 13 00:26:44 2011 +0200

    Only activate ViewActivatable once

 gedit/gedit-view.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index ade98b2..c639b6f 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -73,6 +73,8 @@ struct _GeditViewPrivate
 	GSettings *editor_settings;
 	GtkTextBuffer *current_buffer;
 	PeasExtensionSet *extensions;
+
+	guint view_realized : 1;
 };
 
 G_DEFINE_TYPE(GeditView, gedit_view, GTK_SOURCE_TYPE_VIEW)
@@ -640,10 +642,14 @@ gedit_view_realize (GtkWidget *widget)
 {
 	GeditView *view = GEDIT_VIEW (widget);
 
-	/* We only activate the extensions when the view is realized,
-	 * because most plugins will expect this behaviour, and we won't
-	 * change the buffer later anyway. */
-	peas_extension_set_call (view->priv->extensions, "activate");
+	if (!view->priv->view_realized)
+	{
+		/* We only activate the extensions when the view is realized,
+		 * because most plugins will expect this behaviour, and we won't
+		 * change the buffer later anyway. */
+		peas_extension_set_call (view->priv->extensions, "activate");
+		view->priv->view_realized = TRUE;
+	}
 
 	GTK_WIDGET_CLASS (gedit_view_parent_class)->realize (widget);
 }



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