Index: chrome/browser/renderer_host/render_widget_host_view_gtk.cc |
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc |
index 5ef533dea8fd6912004f05859bb5833fc9e791e3..b64dc54d99b8b5eb8376109a27b3654f06b22958 100644 |
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc |
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc |
@@ -602,9 +602,15 @@ void RenderWidgetHostViewGtk::WasHidden() { |
} |
void RenderWidgetHostViewGtk::SetSize(const gfx::Size& size) { |
+ gfx::Rect rect = GetViewBounds(); |
+ rect.set_size(size); |
+ SetBounds(rect); |
Evan Stade
2011/02/22 19:56:19
this is backwards. SetBounds should use SetSize, n
honten.org
2011/02/23 01:31:57
Done.
|
+} |
+ |
+void RenderWidgetHostViewGtk::SetBounds(const gfx::Rect& rect) { |
// This is called when webkit has sent us a Move message. |
- int width = std::min(size.width(), kMaxWindowWidth); |
- int height = std::min(size.height(), kMaxWindowHeight); |
+ int width = std::min(rect.width(), kMaxWindowWidth); |
+ int height = std::min(rect.height(), kMaxWindowHeight); |
if (IsPopup()) { |
// We're a popup, honor the size request. |
gtk_widget_set_size_request(view_.get(), width, height); |
@@ -616,6 +622,11 @@ void RenderWidgetHostViewGtk::SetSize(const gfx::Size& size) { |
gtk_widget_set_size_request(view_.get(), width, height); |
#endif |
} |
+ |
+ GtkWidget* parent_widget = gtk_widget_get_parent(view_.get()); |
+ if (GTK_IS_WINDOW(parent_widget)) |
+ gtk_window_move(GTK_WINDOW(parent_widget), rect.x(), rect.y()); |
+ |
// Update the size of the RWH. |
if (requested_size_.width() != width || |
requested_size_.height() != height) { |
@@ -663,8 +674,9 @@ bool RenderWidgetHostViewGtk::IsShowing() { |
} |
gfx::Rect RenderWidgetHostViewGtk::GetViewBounds() const { |
- GtkAllocation* alloc = &view_.get()->allocation; |
- return gfx::Rect(alloc->x, alloc->y, |
+ gint x, y; |
+ gtk_widget_get_pointer(view_.get(), &x, &y); |
Evan Stade
2011/02/22 19:56:19
I fail to see how the location of the pointer is r
honten.org
2011/02/23 01:31:57
Roll back.
On 2011/02/22 19:56:19, Evan Stade wrot
|
+ return gfx::Rect(x, y, |
requested_size_.width(), |
requested_size_.height()); |
} |