diff options
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r-- | gtk/gtknotebook.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index aa1a5ade06..e42e2fa7dc 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3094,8 +3094,6 @@ static gint gtk_notebook_focus_in (GtkWidget *widget, GdkEventFocus *event) { - GTK_NOTEBOOK (widget)->child_has_focus = FALSE; - gtk_notebook_redraw_tabs (GTK_NOTEBOOK (widget)); return FALSE; @@ -3978,6 +3976,8 @@ gtk_notebook_set_focus_child (GtkContainer *container, } } } + else + notebook->child_has_focus = FALSE; GTK_CONTAINER_CLASS (gtk_notebook_parent_class)->set_focus_child (container, child); } @@ -5799,9 +5799,14 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num) { + gboolean child_has_focus; + if (notebook->cur_page == page || !GTK_WIDGET_VISIBLE (page->child)) return; + /* save the value here, changing visibility changes focus */ + child_has_focus = notebook->child_has_focus; + if (notebook->cur_page) gtk_widget_set_child_visible (notebook->cur_page->child, FALSE); @@ -5818,7 +5823,7 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook, * element on the new page, if possible, or if not, to the * notebook itself. */ - if (notebook->child_has_focus) + if (child_has_focus) { if (notebook->cur_page->last_focus_child && gtk_widget_is_ancestor (notebook->cur_page->last_focus_child, notebook->cur_page->child)) @@ -7193,6 +7198,8 @@ gtk_notebook_child_reordered (GtkNotebook *notebook, * Sets the packing parameters for the tab label of the page * containing @child. See gtk_box_pack_start() for the exact meaning * of the parameters. + * + * Deprecated: 2.20: Modify the "expand" and "fill" child properties instead. **/ void gtk_notebook_set_tab_label_packing (GtkNotebook *notebook, @@ -7244,6 +7251,8 @@ gtk_notebook_set_tab_label_packing (GtkNotebook *notebook, * * Query the packing attributes for the tab label of the page * containing @child. + * + * Deprecated: 2.20: Modify the "expand" and "fill" child properties instead. **/ void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook, |