From c75c32cc9dff47b1230366e1044bdf6b5ba6495c Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 14 Jul 2014 12:51:02 +0200 Subject: Fix RenderWidgetHostViewQt::GetViewBounds GetViewBounds should return the bounds of the view, not the screen rect. The view bounds are for example used to calculate the screen position of accessible objects (which gets fixed with this patch). Change-Id: I5b342113af737847c1756a13183cd2b8b8db648a Reviewed-by: Andras Becsi Reviewed-by: Michael Bruning --- src/core/render_widget_host_view_qt.cpp | 2 +- src/core/render_widget_host_view_qt_delegate.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index f29e36ae5..76d599ea2 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -316,7 +316,7 @@ bool RenderWidgetHostViewQt::IsShowing() // Retrieve the bounds of the View, in screen coordinates. gfx::Rect RenderWidgetHostViewQt::GetViewBounds() const { - QRectF p = m_delegate->screenRect(); + QRectF p = m_delegate->contentsRect(); float s = dpiScale(); gfx::Point p1(floor(p.x() / s), floor(p.y() / s)); gfx::Point p2(ceil(p.right() /s), ceil(p.bottom() / s)); diff --git a/src/core/render_widget_host_view_qt_delegate.h b/src/core/render_widget_host_view_qt_delegate.h index a8515e0e3..122b7c6eb 100644 --- a/src/core/render_widget_host_view_qt_delegate.h +++ b/src/core/render_widget_host_view_qt_delegate.h @@ -76,6 +76,7 @@ public: virtual void initAsChild(WebContentsAdapterClient*) = 0; virtual void initAsPopup(const QRect&) = 0; virtual QRectF screenRect() const = 0; + virtual QRectF contentsRect() const = 0; virtual void setKeyboardFocus() = 0; virtual bool hasKeyboardFocus() = 0; virtual void show() = 0; -- cgit v1.2.3