aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-07-11 04:44:03 +0800
committerChristian Persch <chpe@src.gnome.org>2006-07-11 04:44:03 +0800
commit19086cf25f2dff6194d44c68078f679d7c269836 (patch)
tree968d78921bc9cd2ae00256cf2f369baaa15e23c2 /lib
parent2a9853a35481dd27d4aad63523c01c00b636d024 (diff)
downloadgsoc2013-epiphany-19086cf25f2dff6194d44c68078f679d7c269836.tar
gsoc2013-epiphany-19086cf25f2dff6194d44c68078f679d7c269836.tar.gz
gsoc2013-epiphany-19086cf25f2dff6194d44c68078f679d7c269836.tar.bz2
gsoc2013-epiphany-19086cf25f2dff6194d44c68078f679d7c269836.tar.lz
gsoc2013-epiphany-19086cf25f2dff6194d44c68078f679d7c269836.tar.xz
gsoc2013-epiphany-19086cf25f2dff6194d44c68078f679d7c269836.tar.zst
gsoc2013-epiphany-19086cf25f2dff6194d44c68078f679d7c269836.zip
Work around bug #346662 by not changing selection while removing the
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/widgets/ephy-node-view.c15
1 files changed, 15 insertions, 0 deletions
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)