Bug 801989 part.4 Set InputContext::mNativeIMEContext on Mac r=smichaud

This commit is contained in:
Masayuki Nakano 2012-10-27 08:35:21 +09:00
Родитель 1825df8ec9
Коммит fd84f5d65b
2 изменённых файлов: 17 добавлений и 0 удалений

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

@ -1613,6 +1613,13 @@ nsChildView::GetInputContext()
mInputContext.mIMEState.mOpen = IMEState::CLOSED;
break;
}
mInputContext.mNativeIMEContext = [mView inputContext];
// If input context isn't available on this widget, we should set |this|
// instead of nullptr since nullptr means that the platform has only one
// context per process.
if (!mInputContext.mNativeIMEContext) {
mInputContext.mNativeIMEContext = this;
}
return mInputContext;
}

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

@ -294,6 +294,16 @@ public:
}
NS_IMETHOD_(InputContext) GetInputContext()
{
NSView* view = mWindow ? [mWindow contentView] : nil;
if (view) {
mInputContext.mNativeIMEContext = [view inputContext];
}
// If inputContext isn't available on this window, returns this window's
// pointer since nullptr means the platform has only one context per
// process.
if (!mInputContext.mNativeIMEContext) {
mInputContext.mNativeIMEContext = this;
}
return mInputContext;
}
NS_IMETHOD BeginSecureKeyboardInput();