зеркало из https://github.com/mozilla/gecko-dev.git
Bug 951966 part.1 Add new pref to support IMM-IME even in TSF mode and rename intl.enable_tsf_support to intl.tsf.enable r=jimm
This commit is contained in:
Родитель
e33e7c5a9c
Коммит
6915530fae
|
@ -53,7 +53,8 @@ pref("apz.axis_lock_mode", 2);
|
|||
pref("apz.cross_slide.enabled", true);
|
||||
|
||||
// Enable Microsoft TSF support by default for imes.
|
||||
pref("intl.enable_tsf_support", true);
|
||||
pref("intl.tsf.enable", true);
|
||||
pref("intl.tsf.support_imm", false);
|
||||
|
||||
pref("general.autoScroll", true);
|
||||
pref("general.smoothScroll", true);
|
||||
|
|
|
@ -2552,7 +2552,10 @@ pref("intl.keyboard.per_window_layout", false);
|
|||
|
||||
#ifdef NS_ENABLE_TSF
|
||||
// Enable/Disable TSF support
|
||||
pref("intl.enable_tsf_support", false);
|
||||
pref("intl.tsf.enable", false);
|
||||
|
||||
// Support IMEs implemented with IMM in TSF mode.
|
||||
pref("intl.tsf.support_imm", true);
|
||||
|
||||
// We need to notify the layout change to TSF, but we cannot check the actual
|
||||
// change now, therefore, we always notify it by this fequency.
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "WinIMEHandler.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsIMM32Handler.h"
|
||||
#include "nsWindowDefs.h"
|
||||
|
||||
|
@ -23,6 +25,7 @@ namespace widget {
|
|||
|
||||
#ifdef NS_ENABLE_TSF
|
||||
bool IMEHandler::sIsInTSFMode = false;
|
||||
bool IMEHandler::sIsIMMEnabled = true;
|
||||
bool IMEHandler::sPluginHasFocus = false;
|
||||
IMEHandler::SetInputScopesFunc IMEHandler::sSetInputScopes = nullptr;
|
||||
#endif // #ifdef NS_ENABLE_TSF
|
||||
|
@ -34,6 +37,8 @@ IMEHandler::Initialize()
|
|||
#ifdef NS_ENABLE_TSF
|
||||
nsTextStore::Initialize();
|
||||
sIsInTSFMode = nsTextStore::IsInTSFMode();
|
||||
sIsIMMEnabled =
|
||||
!sIsInTSFMode || Preferences::GetBool("intl.tsf.support_imm", true);
|
||||
if (!sIsInTSFMode) {
|
||||
// When full nsTextStore is not available, try to use SetInputScopes API
|
||||
// to enable at least InputScope. Use GET_MODULE_HANDLE_EX_FLAG_PIN to
|
||||
|
|
|
@ -125,6 +125,9 @@ private:
|
|||
static void SetInputScopeForIMM32(nsWindow* aWindow,
|
||||
const nsAString& aHTMLInputType);
|
||||
static bool sIsInTSFMode;
|
||||
// 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 sPluginHasFocus;
|
||||
|
||||
static bool IsTSFAvailable() { return (sIsInTSFMode && !sPluginHasFocus); }
|
||||
|
|
|
@ -28,6 +28,12 @@
|
|||
using namespace mozilla;
|
||||
using namespace mozilla::widget;
|
||||
|
||||
static const char* kPrefNameTSFEnabled = "intl.tsf.enable";
|
||||
static const char* kPrefNameLayoutChangeInternal =
|
||||
"intl.tsf.on_layout_change_interval";
|
||||
|
||||
static const char* kLegacyPrefNameTSFEnabled = "intl.enable_tsf_support";
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
/**
|
||||
* TSF related code should log its behavior even on release build especially
|
||||
|
@ -3242,7 +3248,14 @@ nsTextStore::Initialize(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool enableTsf = Preferences::GetBool("intl.enable_tsf_support", false);
|
||||
bool enableTsf = Preferences::GetBool(kPrefNameTSFEnabled, false);
|
||||
// Migrate legacy TSF pref to new pref. This should be removed in next
|
||||
// release cycle or later.
|
||||
if (!enableTsf && Preferences::GetBool(kLegacyPrefNameTSFEnabled, false)) {
|
||||
enableTsf = true;
|
||||
Preferences::SetBool(kPrefNameTSFEnabled, true);
|
||||
Preferences::ClearUser(kLegacyPrefNameTSFEnabled);
|
||||
}
|
||||
PR_LOG(sTextStoreLog, PR_LOG_ALWAYS,
|
||||
("TSF: nsTextStore::Initialize(), TSF is %s",
|
||||
enableTsf ? "enabled" : "disabled"));
|
||||
|
@ -3470,7 +3483,7 @@ nsTextStore::Composition::GetLayoutChangeIntervalTime()
|
|||
}
|
||||
|
||||
sTime = std::max(10,
|
||||
Preferences::GetInt("intl.tsf.on_layout_change_interval", 100));
|
||||
Preferences::GetInt(kPrefNameLayoutChangeInternal, 100));
|
||||
return static_cast<uint32_t>(sTime);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче