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 732900 - textview calls gtk_widget_set_allocation() on children out of ::size-allocate
textview calls gtk_widget_set_allocation() on children out of ::size-allocate
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-07-08 14:26 UTC by Carlos Garnacho
Modified: 2014-07-10 03:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
textview: Call gtk_widget_size_allocate() on children widgets invariably (3.57 KB, patch)
2014-07-08 14:27 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-07-08 14:26:01 UTC
Textview used to have this old hack that would recursively translate and set the allocation on children widgets, (presumably for performance, although it's hard to speculate at this moment). This hack didn't turn out to be a problem until commit 4f89eb05c, that indirectly relies on the widget allocation not being manipulated externally, which brings the wrong clippings being applied to textview children (can be seen in the "multiple views" gtk demo)

I'm attaching a patch to remove this hack and just replace it with gtk_widget_size_allocate(), it does seem to bring the expected behavior nowadays, and I can't think any reason it shouldn't.
Comment 1 Carlos Garnacho 2014-07-08 14:27:01 UTC
Created attachment 280162 [details] [review]
textview: Call gtk_widget_size_allocate() on children widgets invariably

There was this hack, taken verbatim from GtkCList according to the comment,
that would recursively translate the allocation during scrolling, and set
it on children widgets through the direct gtk_widget_set_allocation() setter.

Since commit 4f89eb05cf8a, this has caused the wrong clipping areas to children
widgets of a textview. The reasons for this seem lost in time, and the approach
seems indeed wrong for windowed widgets as the repositioning of those windows
couldn't happen.

So replace all of this with just a gtk_widget_size_allocate() call, which does
work ok for the children widgets embedded in the "multiple views" gtk demo, and
ought to work for every other widget.
Comment 2 Matthias Clasen 2014-07-09 03:39:41 UTC
Looks reasonable. I notice that attaching widgets to GTK_TEXT_WINDOW_WIDGET seems broken with or without this patch - the widget never shows up.
Comment 3 Matthias Clasen 2014-07-10 03:01:50 UTC
Attachment 280162 [details] pushed as 7178e34 - textview: Call gtk_widget_size_allocate() on children widgets invariably