summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/render_widget_host_view_qt.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 77588bc16..8e2b0db88 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -1085,6 +1085,11 @@ void RenderWidgetHostViewQt::handleFocusEvent(QFocusEvent *ev)
if (ev->gotFocus()) {
m_host->GotFocus();
m_host->SetActive(true);
+ Q_ASSERT(m_host->IsRenderView());
+ if (ev->reason() == Qt::TabFocusReason)
+ static_cast<content::RenderViewHostImpl*>(m_host)->SetInitialFocus(false);
+ else if (ev->reason() == Qt::BacktabFocusReason)
+ static_cast<content::RenderViewHostImpl*>(m_host)->SetInitialFocus(true);
ev->accept();
} else if (ev->lostFocus()) {
m_host->SetActive(false);