The first time we show the sidebar, gtk_widget_get_allocation()
doesn't return the correct width as the allocation hasn't been
done yet. So use gtk_widget_get_preferred_width() as the minimum
width is what is actually allocated.
gboolean active)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
gboolean active)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
- int w, h, handle_size;
- GtkAllocation allocation, sidebar_allocation;
+ int w, h, sidebar_width, handle_size;
+ GtkAllocation allocation;
gchar *page;
gboolean dialpad_shown;
gchar *page;
gboolean dialpad_shown;
gtk_widget_style_get (priv->pane, "handle_size", &handle_size, NULL);
gtk_widget_style_get (priv->pane, "handle_size", &handle_size, NULL);
- gtk_widget_get_allocation (priv->sidebar, &sidebar_allocation);
+ gtk_widget_get_preferred_width (priv->sidebar, &sidebar_width, NULL);
if (active)
{
gtk_widget_show (priv->sidebar);
if (active)
{
gtk_widget_show (priv->sidebar);
- w += sidebar_allocation.width + handle_size;
+ w += sidebar_width + handle_size;
- w -= sidebar_allocation.width + handle_size;
+ w -= sidebar_width + handle_size;
gtk_widget_hide (priv->sidebar);
}
gtk_widget_hide (priv->sidebar);
}