From 4c305cba0bf7cc021fd355af574b431f0d5a057d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 9 May 2016 09:26:27 +0200 Subject: Disabled WebEngine views should not receive focus. Currently if a QWebEngineView or a QQuickWebEngineView is disabled using setEnabled(false), after loading a web page, the views are automatically focused, and a user might see a blinking caret in an html input for example, even though the user can't interact with it. Fix consists in not calling the Focus() method whenever a view is disabled. Change-Id: I1014fb5898a5ddf01a4e9b14c3eaf5d4006e5131 Task-number: QTBUG-53159 Reviewed-by: Michal Klocek --- src/core/web_contents_view_qt.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/web_contents_view_qt.cpp') diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp index 67addacd5..ae53619ac 100644 --- a/src/core/web_contents_view_qt.cpp +++ b/src/core/web_contents_view_qt.cpp @@ -113,6 +113,8 @@ void WebContentsViewQt::GetContainerBounds(gfx::Rect* out) const void WebContentsViewQt::Focus() { + if (!m_client->isEnabled()) + return; if (content::RenderWidgetHostView *rwhv = m_webContents->GetRenderWidgetHostView()) rwhv->Focus(); m_client->focusContainer(); -- cgit v1.2.3