tui: fix some valgrind warnings

nmt_newt_grid_size_allocate() depends on nmt_newt_grid_size_request()
having been called immediately prior, which would normally be true,
except that NmtNewtSection adjusts the label widgets in its border to
match its allocation, so when its size changes, it will end up calling
size_allocate() on the border with out-of-date requisition data. Fix
that by re-size_requesting the border after modifying it.

https://bugzilla.gnome.org/show_bug.cgi?id=738010
This commit is contained in:
Dan Winship
2014-10-06 10:48:39 -04:00
parent 9c02e1c742
commit 4f9f33fc35

View File

@@ -322,7 +322,10 @@ nmt_newt_section_size_allocate (NmtNewtWidget *widget,
NmtNewtSectionPrivate *priv = NMT_NEWT_SECTION_GET_PRIVATE (widget); NmtNewtSectionPrivate *priv = NMT_NEWT_SECTION_GET_PRIVATE (widget);
if (priv->show_border) { if (priv->show_border) {
int border_height, border_width;
adjust_border_for_allocation (priv, height); adjust_border_for_allocation (priv, height);
nmt_newt_widget_size_request (priv->border_grid, &border_height, &border_width);
nmt_newt_widget_size_allocate (priv->border_grid, x, y, 1, height); nmt_newt_widget_size_allocate (priv->border_grid, x, y, 1, height);
nmt_newt_widget_size_allocate (priv->header, x + 2, y, width, priv->hheight_req); nmt_newt_widget_size_allocate (priv->header, x + 2, y, width, priv->hheight_req);
} else } else