Index: views/widget/widget_gtk.cc |
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc |
index 1f7afb2eecd571227b80de7007eb57b93d94925f..f74eef1357deef9be036c4b0e35b225f77ca2480 100644 |
--- a/views/widget/widget_gtk.cc |
+++ b/views/widget/widget_gtk.cc |
@@ -331,7 +331,7 @@ void WidgetGtk::RemoveChild(GtkWidget* child) { |
// closed. |
if (GTK_IS_CONTAINER(window_contents_)) { |
gtk_container_remove(GTK_CONTAINER(window_contents_), child); |
- gtk_views_fixed_set_use_allocated_size(child, false); |
+ gtk_views_fixed_set_widget_size(child, 0, 0); |
} |
} |
@@ -340,9 +340,7 @@ void WidgetGtk::ReparentChild(GtkWidget* child) { |
} |
void WidgetGtk::PositionChild(GtkWidget* child, int x, int y, int w, int h) { |
- GtkAllocation alloc = { x, y, w, h }; |
- gtk_widget_size_allocate(child, &alloc); |
- gtk_views_fixed_set_use_allocated_size(child, true); |
+ gtk_views_fixed_set_widget_size(child, w, h); |
gtk_fixed_move(GTK_FIXED(window_contents_), child, x, y); |
} |
@@ -429,6 +427,18 @@ RootView* WidgetGtk::GetRootViewForWidget(GtkWidget* widget) { |
return static_cast<RootView*>(user_data); |
} |
+void WidgetGtk::GetRequestedSize(gfx::Size* out) const { |
+ int width, height; |
+ if (GTK_IS_VIEWS_FIXED(widget_) && |
+ gtk_views_fixed_get_widget_size(GetNativeView(), &width, &height)) { |
+ out->SetSize(width, height); |
+ } else { |
+ GtkRequisition requisition; |
+ gtk_widget_get_child_requisition(GetNativeView(), &requisition); |
+ out->SetSize(requisition.width, requisition.height); |
+ } |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// WidgetGtk, ActiveWindowWatcherX::Observer implementation: |