Index: gtk/gtknotebook.c
===================================================================
--- gtk/gtknotebook.c	(revision 17848)
+++ gtk/gtknotebook.c	(working copy)
@@ -221,6 +221,7 @@ static void gtk_notebook_get_property	  
 					      GParamSpec      *pspec);
 
 /*** GtkWidget Methods ***/
+static void gtk_notebook_show                (GtkWidget        *widget);
 static void gtk_notebook_map                 (GtkWidget        *widget);
 static void gtk_notebook_unmap               (GtkWidget        *widget);
 static void gtk_notebook_realize             (GtkWidget        *widget);
@@ -479,6 +480,7 @@ gtk_notebook_class_init (GtkNotebookClas
   gobject_class->get_property = gtk_notebook_get_property;
   object_class->destroy = gtk_notebook_destroy;
 
+  widget_class->show = gtk_notebook_show;
   widget_class->map = gtk_notebook_map;
   widget_class->unmap = gtk_notebook_unmap;
   widget_class->realize = gtk_notebook_realize;
@@ -1553,6 +1555,36 @@ gtk_notebook_get_event_window_position (
 }
 
 static void
+gtk_notebook_show (GtkWidget *widget)
+{
+  GtkNotebook *notebook;
+  GList *list;
+  GList *next = NULL;
+
+  g_return_if_fail (GTK_IS_NOTEBOOK (widget));
+
+  notebook = GTK_NOTEBOOK (widget);
+
+  if (notebook->cur_page &&
+      !GTK_WIDGET_VISIBLE (notebook->cur_page->child))
+    {
+      list = g_list_find (notebook->children, notebook->cur_page);
+      if (list)
+        {
+          next = gtk_notebook_search_page (notebook, list, STEP_NEXT, TRUE);
+          if (!next)
+            next = gtk_notebook_search_page (notebook, list, STEP_PREV, TRUE);
+        }
+
+      if (next)
+        gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE (next), -1);
+    }
+
+  if (GTK_WIDGET_CLASS (gtk_notebook_parent_class)->show)
+    (* GTK_WIDGET_CLASS (gtk_notebook_parent_class)->show) (widget);
+}
+
+static void
 gtk_notebook_map (GtkWidget *widget)
 {
   GtkNotebook *notebook;
@@ -3899,7 +3931,8 @@ page_visible_cb (GtkWidget  *page,
   GList *list;
   GList *next = NULL;
 
-  if (notebook->cur_page &&
+  if (GTK_WIDGET_VISIBLE (notebook) &&
+      notebook->cur_page &&
       notebook->cur_page->child == page &&
       !GTK_WIDGET_VISIBLE (page))
     {
