GNOME Bugzilla – Bug 721407
Criticals on GtkScrolledWindow composite widget
Last modified: 2014-01-05 15:44:05 UTC
Created attachment 265231 [details] Testcase With git master (commit eb6ae0d) of gtk+, if my composite widget is deriving from GtkScrolledWindow, I get following criticals at runtime: (demo:17195): Gtk-CRITICAL **: gtk_range_get_adjustment: assertion 'GTK_IS_RANGE (range)' failed (demo:17195): Gtk-CRITICAL **: gtk_range_get_adjustment: assertion 'GTK_IS_RANGE (range)' failed Backtraces for both: (demo:17287): Gtk-CRITICAL **: gtk_range_get_adjustment: assertion 'GTK_IS_RANGE (range)' failed Program received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffff60c9c53 in _g_log_abort (breakpoint=1) at gmessages.c:309 309 G_BREAKPOINT (); (gdb) bt
+ Trace 232993
I'm attaching a complete app which can be used to reproduce the issue.
Created attachment 265284 [details] [review] Ensure scrollbars at GtkContainerClass->add() time We normally dont have subclasses of GtkScrolledWindow adding composite children at instance initialization time, this patch makes template subclassing possible without interfering with the scrolled window's initialization.
Review of attachment 265284 [details] [review]: ::: gtk/gtkscrolledwindow.c @@ +2931,3 @@ + + if (!priv->vscrollbar) + gtk_scrolled_window_set_vadjustment (scrolled_window, NULL); This looks a little funny, since you are checking a scrollbar, but then set an adjustment. I think a little comment would be in order, like /* gtk_scrolled_window_set_[hv]adjustment has the side-effect of creating * the scrollbars */
(In reply to comment #1) > Created an attachment (id=265284) [details] [review] > Ensure scrollbars at GtkContainerClass->add() time This patch fixes the issue for me, both in the attached test app and Boxes. Thanks for the quick action.
So was the solution some modified version of attached patch here or something else? Would be nice for the record to update the status on the patch here and leave a short comment on the bug about the solution. `git-bz push` helps.
Zeeshan, Matthias committed a modified version of my patch, which simply adds the comment he suggested in his comment above.