GNOME Bugzilla – Bug 669394
Don't call size_allocate for unmapped children
Last modified: 2015-02-12 03:45:18 UTC
Created attachment 206812 [details] [review] notebook: do not call size_allocate for unmapped children gtk_notebook_set_current_page documentation says: "Note that due to historical reasons, GtkNotebook refuses to switch to a page unless the child widget is visible. Therefore, it is recommended to show child widgets before adding them to a notebook." Because of this notebook children are always visible. gtk_notebook_size_allocate() checks whether every child is visible or not to call size_allocate, since all children are always visible size_allocate is called for all notebook children. This makes, for example, an ephy window with several tabs very slow to resize, because size_allocate is called for every WebKitWebView. GtkNotebook::switch-page calls gtk_widget_set_child_visible to make current page visible, and previous one invisible, which maps/unmaps both widgets without changing the visibility property.
But that makes the notebook no longer allocate enough space for every page, I guess ? Certainly not something we can change without some opt-in.
hmm, I'll try to do some tests. Also, maybe it would be better to use gtk_widget_get_child_visible() instead of visible + mapped, since that's what the notebook changes when switching pages.