scrolledwindow: Fix calls to gdk_window_move_resize()

This is a bit of fallout from 34feba1, now that we resolve
the has_indicators value earlier than realize, it becomes
possible to call gdk_window_move_resize() before realization.

Just added the appropriate checks.
This commit is contained in:
Tristan Van Berkom 2016-06-10 21:16:53 +09:00
parent 32675db490
commit a9a59ac55e

View File

@ -1710,11 +1710,12 @@ gtk_scrolled_window_allocate (GtkCssGadget *gadget,
&child_allocation);
if (priv->use_indicators)
{
gdk_window_move_resize (priv->hindicator.window,
child_allocation.x,
child_allocation.y,
child_allocation.width,
child_allocation.height);
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (priv->hindicator.window,
child_allocation.x,
child_allocation.y,
child_allocation.width,
child_allocation.height);
child_allocation.x = 0;
child_allocation.y = 0;
}
@ -1729,11 +1730,12 @@ gtk_scrolled_window_allocate (GtkCssGadget *gadget,
&child_allocation);
if (priv->use_indicators)
{
gdk_window_move_resize (priv->vindicator.window,
child_allocation.x,
child_allocation.y,
child_allocation.width,
child_allocation.height);
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (priv->vindicator.window,
child_allocation.x,
child_allocation.y,
child_allocation.width,
child_allocation.height);
child_allocation.x = 0;
child_allocation.y = 0;
}