summaryrefslogtreecommitdiffstats
path: root/src/core/render_widget_host_view_qt.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2021-03-03 10:13:42 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2021-03-05 11:26:09 +0100
commit84104b7d100553c1550c525759ef6fb4446c31be (patch)
tree4e1b09b6f1fbbd150333d12e8eef440040ffdd90 /src/core/render_widget_host_view_qt.cpp
parentfc3d54dc39e9c7d1ce511567f5b996c2c3f53694 (diff)
Do not hide virtual keyboard if the focused node is editable
Fixes: QTBUG-91257 Change-Id: Ic303278e2b8871e6bcb3f4f5c5810c8f43371bb8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r--src/core/render_widget_host_view_qt.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index c49850929..958c1c3c4 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -782,8 +782,8 @@ void RenderWidgetHostViewQt::OnUpdateTextInputStateCalled(content::TextInputMana
const ui::mojom::TextInputState *state = text_input_manager_->GetTextInputState();
if (!state) {
- m_delegate->inputMethodStateChanged(false /*editorVisible*/, false /*passwordInput*/);
- m_delegate->setInputMethodHints(Qt::ImhNone);
+ // Do not reset input method state here because an editable node might be still focused and
+ // this would hide the virtual keyboard if a child of the focused node is removed.
return;
}
@@ -1867,6 +1867,15 @@ const viz::LocalSurfaceId &RenderWidgetHostViewQt::GetLocalSurfaceId() const
return m_dfhLocalSurfaceIdAllocator.GetCurrentLocalSurfaceId();
}
+void RenderWidgetHostViewQt::FocusedNodeChanged(bool is_editable_node, const gfx::Rect& node_bounds_in_screen)
+{
+ Q_UNUSED(node_bounds_in_screen);
+ if (!is_editable_node) {
+ m_delegate->inputMethodStateChanged(false /*editorVisible*/, false /*passwordInput*/);
+ m_delegate->setInputMethodHints(Qt::ImhNone);
+ }
+}
+
void RenderWidgetHostViewQt::TakeFallbackContentFrom(content::RenderWidgetHostView *view)
{
DCHECK(!static_cast<RenderWidgetHostViewBase*>(view)->IsRenderWidgetHostViewChildFrame());