Bug 1402461 - Improve user input detection for focus changes in Fennec r=jchen

Differential Revision: https://phabricator.services.mozilla.com/D94

MozReview-Commit-ID: 9VyoskwRrO1
This commit is contained in:
James Willcox 2017-10-03 15:19:10 -05:00
Родитель 9047c35a43
Коммит 59bfaa0f09
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -12,6 +12,7 @@
#include "nsIContent.h"
#include "nsISelection.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/IMEStateManager.h"
#include "mozilla/TextComposition.h"
#include "mozilla/TextEventDispatcherListener.h"
@ -1153,9 +1154,11 @@ GeckoEditableSupport::SetInputContext(const InputContext& aContext,
aAction.mCause, aAction.mFocusChange);
mInputContext = aContext;
const bool isUserAction = EventStateManager::IsHandlingUserInput();
if (mInputContext.mIMEState.mEnabled == IMEState::ENABLED &&
aAction.UserMightRequestOpenVKB()) {
isUserAction &&
aAction.mFocusChange == InputContextAction::FOCUS_NOT_CHANGED) {
// Don't reset keyboard when we should simply open the vkb
mEditable->NotifyIME(GeckoEditableListener::NOTIFY_IME_OPEN_VKB);
return;
@ -1167,8 +1170,6 @@ GeckoEditableSupport::SetInputContext(const InputContext& aContext,
mIMEUpdatingContext = true;
RefPtr<GeckoEditableSupport> self(this);
bool isUserAction = aAction.IsUserAction();
nsAppShell::PostEvent([this, self, isUserAction] {
nsCOMPtr<nsIWidget> widget = GetWidget();