From 1190efebce5892f80545a91461c6b9c80abfd7e7 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 19 Dec 2015 06:56:04 +0100 Subject: [PATCH] notebook: Set the current page when none is set This case happens when you gtk_widget_show_all (notebook). --- gtk/gtknotebook.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index ce05f75a68..f43b7da712 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -4771,6 +4771,13 @@ page_visible_cb (GtkWidget *child, if (next) gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE (next)); } + + if (!priv->cur_page && gtk_widget_get_visible (child)) + { + gtk_notebook_switch_page (notebook, page); + /* focus_tab is set in the switch_page method */ + gtk_notebook_switch_focus_tab (notebook, priv->focus_tab); + } } static gint