listbase: Clear any newly set adjustments
The scrolling code assumes the adjustment values are up to date or it crashes and before we've run size_allocate() we haven't update them. Fixes a crash in the gtk-demo scrollinfo that would set the adjustments with random values (via ScrolledWindow.set_child()) and then scroll in a tick callback right before the (first) size_allocate().
This commit is contained in:
@@ -731,6 +731,8 @@ gtk_list_base_set_adjustment (GtkListBase *self,
|
||||
|
||||
if (adjustment == NULL)
|
||||
adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
else
|
||||
gtk_adjustment_configure (adjustment, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
g_object_ref_sink (adjustment);
|
||||
|
||||
gtk_list_base_clear_adjustment (self, orientation);
|
||||
|
||||
Reference in New Issue
Block a user