Bug 1796044 - part 14: Get rid of `intl.tsf.associate_imc_only_when_imm_ime_is_active` r=m_kato

It's introduced in bug 1367692 to make it possible to test the bug of old
MS-IME on Windows 10 with later versions.  Now, the bug and the old versions
have gone.  Therefore, we don't need this pref anymore.

Depends on D159816

Differential Revision: https://phabricator.services.mozilla.com/D159817
This commit is contained in:
Masayuki Nakano 2022-10-25 07:07:00 +00:00
Родитель b224ff9c39
Коммит 4deece589a
3 изменённых файлов: 2 добавлений и 42 удалений

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

@ -2544,12 +2544,6 @@ pref("font.size.monospace.x-math", 13);
// Support IMEs implemented with IMM in TSF mode.
pref("intl.tsf.support_imm", true);
// This is referred only when both "intl.tsf.enable" and
// "intl.tsf.support_imm" are true. When this is true, default IMC is
// associated with focused window only when active keyboard layout is a
// legacy IMM-IME.
pref("intl.tsf.associate_imc_only_when_imm_ime_is_active", false);
// If composition_font is set, Gecko sets the font to IME. IME may use
// the fonts on their window like candidate window. If they are empty,
// Gecko uses the system default font which is set to the IM context.

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

@ -7,7 +7,7 @@
#include "IMMHandler.h"
#include "mozilla/Preferences.h"
#include "mozilla/StaticPrefList_intl.h"
#include "mozilla/StaticPrefs_intl.h"
#include "mozilla/TextEvents.h"
#include "mozilla/WindowsVersion.h"
#include "nsWindowDefs.h"
@ -59,7 +59,6 @@ bool IMEHandler::sHasNativeCaretBeenRequested = false;
bool IMEHandler::sIsInTSFMode = false;
bool IMEHandler::sIsIMMEnabled = true;
bool IMEHandler::sAssociateIMCOnlyWhenIMM_IMEActive = false;
decltype(SetInputScopes)* IMEHandler::sSetInputScopes = nullptr;
static POWER_PLATFORM_ROLE sPowerPlatformRole = PlatformRoleUnspecified;
@ -71,10 +70,6 @@ void IMEHandler::Initialize() {
sIsInTSFMode = TSFTextStore::IsInTSFMode();
sIsIMMEnabled =
!sIsInTSFMode || Preferences::GetBool("intl.tsf.support_imm", true);
sAssociateIMCOnlyWhenIMM_IMEActive =
sIsIMMEnabled &&
Preferences::GetBool("intl.tsf.associate_imc_only_when_imm_ime_is_active",
false);
if (!sIsInTSFMode) {
// When full TSFTextStore is not available, try to use SetInputScopes API
// to enable at least InputScope. Use GET_MODULE_HANDLE_EX_FLAG_PIN to
@ -414,10 +409,7 @@ void IMEHandler::OnDestroyWindow(nsWindow* aWindow) {
}
// static
bool IMEHandler::NeedsToAssociateIMC() {
return !sForceDisableCurrentIMM_IME &&
(!sAssociateIMCOnlyWhenIMM_IMEActive || !IsIMMActive());
}
bool IMEHandler::NeedsToAssociateIMC() { return !sForceDisableCurrentIMM_IME; }
// static
void IMEHandler::SetInputContext(nsWindow* aWindow, InputContext& aInputContext,
@ -542,31 +534,6 @@ void IMEHandler::OnKeyboardLayoutChanged() {
if (!sIsIMMEnabled || !IsTSFAvailable()) {
return;
}
// We don't need to do anything when sAssociateIMCOnlyWhenIMM_IMEActive is
// false because IMContext won't be associated/disassociated when changing
// active keyboard layout/IME.
if (!sAssociateIMCOnlyWhenIMM_IMEActive) {
return;
}
// If there is no TSFTextStore which has focus, i.e., no editor has focus,
// nothing to do here.
nsWindow* windowBase = TSFTextStore::GetEnabledWindowBase();
if (!windowBase) {
return;
}
// If IME isn't available, nothing to do here.
InputContext inputContext = windowBase->GetInputContext();
if (!WinUtils::IsIMEEnabled(inputContext)) {
return;
}
// Associate or Disassociate IMC if it's necessary.
// Note that this does nothing if the window has already associated with or
// disassociated from the window.
AssociateIMEContext(windowBase, NeedsToAssociateIMC());
}
// static

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

@ -202,7 +202,6 @@ class IMEHandler final {
// If sIMMEnabled is false, any IME messages are not handled in TSF mode.
// Additionally, IME context is always disassociated from focused window.
static bool sIsIMMEnabled;
static bool sAssociateIMCOnlyWhenIMM_IMEActive;
static bool IsTSFAvailable() { return sIsInTSFMode; }
static bool IsIMMActive();