aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-11-21 09:22:52 +0800
committerChristian Persch <chpe@src.gnome.org>2004-11-21 09:22:52 +0800
commit85b4579374f5f4ecfd04920c2ce409a461d3d1fc (patch)
tree0f2a29ec9b2401e3b18ca02bcd09aee6afb81b56 /src
parentcee57b1d5a639833585528c14288925537db1856 (diff)
downloadgsoc2013-epiphany-85b4579374f5f4ecfd04920c2ce409a461d3d1fc.tar
gsoc2013-epiphany-85b4579374f5f4ecfd04920c2ce409a461d3d1fc.tar.gz
gsoc2013-epiphany-85b4579374f5f4ecfd04920c2ce409a461d3d1fc.tar.bz2
gsoc2013-epiphany-85b4579374f5f4ecfd04920c2ce409a461d3d1fc.tar.lz
gsoc2013-epiphany-85b4579374f5f4ecfd04920c2ce409a461d3d1fc.tar.xz
gsoc2013-epiphany-85b4579374f5f4ecfd04920c2ce409a461d3d1fc.tar.zst
gsoc2013-epiphany-85b4579374f5f4ecfd04920c2ce409a461d3d1fc.zip
If the signal handler for tab-added reordered the tabs, emit the
2004-11-21 Christian Persch <chpe@cvs.gnome.org> * src/ephy-notebook.c: (ephy_notebook_add_tab): If the signal handler for tab-added reordered the tabs, emit the tabs-reordered signal.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-notebook.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 88ddddd68..ed8ea73d3 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -926,6 +926,7 @@ ephy_notebook_add_tab (EphyNotebook *nb,
gboolean jump_to)
{
GtkWidget *label;
+ int new_position;
g_return_if_fail (EPHY_IS_TAB (tab));
@@ -956,15 +957,24 @@ ephy_notebook_add_tab (EphyNotebook *nb,
g_signal_emit (G_OBJECT (nb), signals[TAB_ADDED], 0, tab);
- if (jump_to)
+ /* The signal handler may have reordered the tabs */
+ new_position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), GTK_WIDGET (tab));
+
+ /* if the signal handler reordered the tabs, emit "tabs-reordered",
+ * so that the tabs menu updates itself.
+ */
+ if (position != new_position)
{
- /* The signal handler may have reordered the tabs */
- position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), GTK_WIDGET(tab));
+ g_signal_emit (nb, signals[TABS_REORDERED], 0);
+ }
+ if (jump_to)
+ {
gtk_notebook_set_current_page (GTK_NOTEBOOK (nb),
- position);
+ new_position);
g_object_set_data (G_OBJECT (tab), "jump_to",
GINT_TO_POINTER (jump_to));
+
}
}