aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--lib/widgets/ephy-node-view.c15
2 files changed, 23 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ab978303..2eb5cd717 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2006-07-10 Christian Persch <chpe@cvs.gnome.org>
+ * lib/widgets/ephy-node-view.c:
+ (ephy_node_view_selection_changed_cb), (ephy_node_view_remove):
+
+ Work around bug #346662 by not changing selection while removing the
+ nodes. Fixes crash with gtk 2.10.
+
+2006-07-10 Christian Persch <chpe@cvs.gnome.org>
+
* src/ephy-window.c: (settings_change_notify),
(ephy_window_key_press_event):
diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c
index cec722019..fcbc34e18 100644
--- a/lib/widgets/ephy-node-view.c
+++ b/lib/widgets/ephy-node-view.c
@@ -79,6 +79,8 @@ struct _EphyNodeViewPrivate
gboolean have_drag_data;
GtkSelectionData *drag_data;
guint scroll_id;
+
+ guint changing_selection : 1;
};
enum
@@ -503,9 +505,13 @@ static void
ephy_node_view_selection_changed_cb (GtkTreeSelection *selection,
EphyNodeView *view)
{
+ EphyNodeViewPrivate *priv = view->priv;
GList *list;
EphyNode *node = NULL;
+ /* Work around bug #346662 */
+ if (priv->changing_selection) return;
+
list = ephy_node_view_get_selection (view);
if (list)
{
@@ -1368,11 +1374,13 @@ ephy_node_view_get_selection (EphyNodeView *view)
void
ephy_node_view_remove (EphyNodeView *view)
{
+ EphyNodeViewPrivate *priv = view->priv;
GList *list, *l;
EphyNode *node;
GtkTreeIter iter, iter2;
GtkTreePath *path;
GtkTreeRowReference *row_ref = NULL;
+ GtkTreeSelection *selection;
/* Before removing we try to get a reference to the next node in the view. If that is
* not available we try with the previous one, and if that is absent too,
@@ -1406,13 +1414,20 @@ ephy_node_view_remove (EphyNodeView *view)
}
gtk_tree_path_free (path);
+ /* Work around bug #346662 */
+ priv->changing_selection = TRUE;
for (l = list; l != NULL; l = l->next)
{
ephy_node_unref (l->data);
}
+ priv->changing_selection = FALSE;
g_list_free (list);
+ /* Fake a selection changed signal */
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
+ g_signal_emit_by_name (selection, "changed");
+
/* Select the "next" node */
if (row_ref != NULL)