[gedit] Active the view extensions when the view is realized.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Active the view extensions when the view is realized.
- Date: Thu, 29 Jul 2010 19:17:36 +0000 (UTC)
commit aed206a36a561a60fd06db66182f91ad8d666992
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Thu Jul 29 21:17:14 2010 +0200
Active the view extensions when the view is realized.
gedit/gedit-view.c | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index 218beaf..b053c22 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -129,6 +129,7 @@ static gboolean gedit_view_drag_drop (GtkWidget *widget,
guint timestamp);
static gboolean gedit_view_button_press_event (GtkWidget *widget,
GdkEventButton *event);
+static void gedit_view_realize (GtkWidget *widget);
static gboolean start_interactive_search (GeditView *view);
static gboolean start_interactive_goto_line (GeditView *view);
@@ -214,6 +215,7 @@ gedit_view_class_init (GeditViewClass *klass)
widget_class->drag_data_received = gedit_view_drag_data_received;
widget_class->drag_drop = gedit_view_drag_drop;
widget_class->button_press_event = gedit_view_button_press_event;
+ widget_class->realize = gedit_view_realize;
klass->start_interactive_search = start_interactive_search;
klass->start_interactive_goto_line = start_interactive_goto_line;
klass->reset_searched_text = reset_searched_text;
@@ -353,11 +355,6 @@ on_notify_buffer_cb (GeditView *view,
"search_highlight_updated",
G_CALLBACK (search_highlight_updated_cb),
view);
-
- /* We only activate the extensions when the right buffer is set,
- * because most plugins will expect this behaviour, and we won't
- * change the buffer later anyway. */
- peas_extension_set_call (view->priv->extensions, "activate");
}
static void
@@ -468,7 +465,6 @@ gedit_view_init (GeditView *view)
"notify::buffer",
G_CALLBACK (on_notify_buffer_cb),
NULL);
-
}
static void
@@ -480,8 +476,7 @@ gedit_view_destroy (GtkObject *object)
if (view->priv->extensions != NULL)
{
- peas_extension_set_call (view->priv->extensions,
- "deactivate");
+ peas_extension_set_call (view->priv->extensions, "deactivate");
g_object_unref (view->priv->extensions);
view->priv->extensions = NULL;
}
@@ -2164,6 +2159,19 @@ gedit_view_button_press_event (GtkWidget *widget, GdkEventButton *event)
return GTK_WIDGET_CLASS (gedit_view_parent_class)->button_press_event (widget, event);
}
+static void
+gedit_view_realize (GtkWidget *widget)
+{
+ GeditView *view = GEDIT_VIEW (widget);
+
+ GTK_WIDGET_CLASS (gedit_view_parent_class)->realize (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");
+}
+
static void
search_highlight_updated_cb (GeditDocument *doc,
GtkTextIter *start,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]