+ view_allocation->x = 0;
+ view_allocation->y = 0;
+
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
+
+ gtk_style_context_get_padding (context, state, &padding);
+ gtk_style_context_get_border (context, state, &border);
+
+ gtk_style_context_restore (context);
+
+ if (priv->shadow_type != GTK_SHADOW_NONE)
+ {
+ view_allocation->x = border.left;
+ view_allocation->y = border.top;
+ }
+
+ view_allocation->x += padding.left;
+ view_allocation->y += padding.top;
+ view_allocation->width = MAX (1, allocation.width - padding.left - padding.right - border_width * 2);
+ view_allocation->height = MAX (1, allocation.height - padding.top - padding.bottom - border_width * 2);
+
+ if (priv->shadow_type != GTK_SHADOW_NONE)
+ {
+ view_allocation->width = MAX (1, view_allocation->width - border.left - border.right);
+ view_allocation->height = MAX (1, view_allocation->height - border.top - border.bottom);
+ }