Bug 1224605 - also show the OSK when tapping in focused inputs, r=masayuki

--HG--
extra : commitid : Dk5EQ4MMs4X
extra : rebase_source : 3bfa3f930a95904d2b179b58f3735f2e1cae1dc0
This commit is contained in:
Gijs Kruitbosch 2015-12-08 09:56:27 -05:00
Родитель 397ca2b9bc
Коммит 297357597f
3 изменённых файлов: 14 добавлений и 3 удалений

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

@ -77,6 +77,8 @@ GetActionCauseName(InputContextAction::Cause aCause)
return "CAUSE_KEY";
case InputContextAction::CAUSE_MOUSE:
return "CAUSE_MOUSE";
case InputContextAction::CAUSE_TOUCH:
return "CAUSE_TOUCH";
default:
return "illegal value";
}
@ -657,8 +659,13 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
return; // should notify only first click event.
}
InputContextAction action(InputContextAction::CAUSE_MOUSE,
InputContextAction::FOCUS_NOT_CHANGED);
uint16_t inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
aMouseEvent->GetMozInputSource(&inputSource);
InputContextAction::Cause cause =
inputSource == nsIDOMMouseEvent::MOZ_SOURCE_TOUCH ?
InputContextAction::CAUSE_TOUCH : InputContextAction::CAUSE_MOUSE;
InputContextAction action(cause, InputContextAction::FOCUS_NOT_CHANGED);
IMEState newState = GetNewIMEState(aPresContext, aContent);
SetIMEState(newState, aContent, widget, action);
}

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

@ -341,7 +341,7 @@ struct InputContextAction final
bool UserMightRequestOpenVKB() const
{
return (mFocusChange == FOCUS_NOT_CHANGED &&
mCause == CAUSE_MOUSE);
(mCause == CAUSE_MOUSE || mCause == CAUSE_TOUCH));
}
InputContextAction()

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

@ -374,6 +374,10 @@ IMEHandler::SetInputContext(nsWindow* aWindow,
// Assume that SetInputContext() is called only when aWindow has focus.
sPluginHasFocus = (aInputContext.mIMEState.mEnabled == IMEState::PLUGIN);
if (aAction.UserMightRequestOpenVKB()) {
IMEHandler::MaybeShowOnScreenKeyboard();
}
bool enable = WinUtils::IsIMEEnabled(aInputContext);
bool adjustOpenState = (enable &&
aInputContext.mIMEState.mOpen != IMEState::DONT_CHANGE_OPEN_STATE);