After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 669394 - Don't call size_allocate for unmapped children
Don't call size_allocate for unmapped children
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-02-05 11:20 UTC by Carlos Garcia Campos
Modified: 2015-02-12 03:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
notebook: do not call size_allocate for unmapped children (1.62 KB, patch)
2012-02-05 11:20 UTC, Carlos Garcia Campos
none Details | Review

Description Carlos Garcia Campos 2012-02-05 11:20:03 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.
Comment 1 Matthias Clasen 2012-02-05 23:59:16 UTC
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.
Comment 2 Carlos Garcia Campos 2012-02-06 07:43:01 UTC
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.