Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Unified Diff: content/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 7745002: GetViewBounds should use screen coordinates but not parents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use requested_size_ Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_gtk.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc
index b6b5ec92efdec5882c9ce5ca67bc3aa93eae84a0..ed63c9aba291faa8c0e81aab3f8f6fe36bf53f80 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -726,10 +726,13 @@ bool RenderWidgetHostViewGtk::IsShowing() {
}
gfx::Rect RenderWidgetHostViewGtk::GetViewBounds() const {
- GtkAllocation* alloc = &view_.get()->allocation;
- return gfx::Rect(alloc->x, alloc->y,
- requested_size_.width(),
- requested_size_.height());
+ GdkWindow* gdk_window = view_.get()->window;
+ if (!gdk_window)
+ return gfx::Rect(requested_size_);
+ GdkRectangle window_rect;
+ gdk_window_get_origin(gdk_window, &window_rect.x, &window_rect.y);
+ return gfx::Rect(window_rect.x, window_rect.y,
+ requested_size_.width(), requested_size_.height());
}
void RenderWidgetHostViewGtk::UpdateCursor(const WebCursor& cursor) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698