From d84ac1a806234b26e4f4ea67222c85b8dcfab815 Mon Sep 17 00:00:00 2001 From: ffanny <1402826485@qq.com> Date: Tue, 26 Feb 2019 10:35:05 +0800 Subject: [PATCH] Fix: https://github.com/nwjs/nw.js/issues/6985 --- content/browser/renderer_host/render_widget_host_impl.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 9832053c72a8d..d960cb40be2a0 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -1081,8 +1081,13 @@ void RenderWidgetHostImpl::SetPageFocus(bool focused) { if (IsKeyboardLocked()) UnlockKeyboard(); - if (auto* touch_emulator = GetExistingTouchEmulator()) - touch_emulator->CancelTouch(); + if (auto* touch_emulator = GetExistingTouchEmulator()) { + if (touch_emulator->rfh_limit()) { + if (touch_emulator->rfh_limit()->GetView() == GetView()) + touch_emulator->CancelTouch(); + } else + touch_emulator->CancelTouch(); + } } else if (keyboard_lock_allowed_) { LockKeyboard(); }