mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1063669 - Don't enable e10s if IME is detected (r=jimm)
This commit is contained in:
parent
2848670cb0
commit
fd4b7d5ba2
@ -2287,6 +2287,7 @@ let E10SUINotification = {
|
||||
|
||||
if (!Services.appinfo.inSafeMode &&
|
||||
!Services.appinfo.accessibilityEnabled &&
|
||||
!Services.appinfo.keyboardMayHaveIME &&
|
||||
e10sPromptShownCount < 5) {
|
||||
Services.tm.mainThread.dispatch(() => {
|
||||
try {
|
||||
|
@ -584,6 +584,28 @@ CanShowProfileManager()
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool
|
||||
KeyboardMayHaveIME()
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/dd318693%28v=vs.85%29.aspx
|
||||
HKL locales[10];
|
||||
int result = GetKeyboardLayoutList(10, locales);
|
||||
for (int i = 0; i < result; i++) {
|
||||
int kb = (unsigned)locales[i] & 0xFFFF;
|
||||
if (kb == 0x0411 || // japanese
|
||||
kb == 0x0412 || // korean
|
||||
kb == 0x0C04 || // HK Chinese
|
||||
kb == 0x0804 || kb == 0x0004 || // Hans Chinese
|
||||
kb == 0x7C04 || kb == 0x0404) { //Hant Chinese
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool gSafeMode = false;
|
||||
|
||||
@ -845,6 +867,13 @@ nsXULAppInfo::GetAccessibilityEnabled(bool* aResult)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAppInfo::GetKeyboardMayHaveIME(bool* aResult)
|
||||
{
|
||||
*aResult = KeyboardMayHaveIME();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAppInfo::EnsureContentProcess()
|
||||
{
|
||||
@ -4541,8 +4570,9 @@ bool
|
||||
mozilla::BrowserTabsRemoteAutostart()
|
||||
{
|
||||
if (!gBrowserTabsRemoteAutostartInitialized) {
|
||||
bool hasIME = KeyboardMayHaveIME();
|
||||
bool prefEnabled = Preferences::GetBool("browser.tabs.remote.autostart", false) ||
|
||||
Preferences::GetBool("browser.tabs.remote.autostart.1", false);
|
||||
(Preferences::GetBool("browser.tabs.remote.autostart.1", false) && !hasIME);
|
||||
bool disabledForA11y = Preferences::GetBool("browser.tabs.remote.autostart.disabled-because-using-a11y", false);
|
||||
gBrowserTabsRemoteAutostart = !gSafeMode && !disabledForA11y && prefEnabled;
|
||||
|
||||
|
@ -25,7 +25,7 @@ bool BrowserTabsRemoteAutostart();
|
||||
* stable/frozen, please contact Benjamin Smedberg.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(77550b90-3b67-11e4-916c-0800200c9a66)]
|
||||
[scriptable, uuid(789073a0-3f4a-11e4-916c-0800200c9a66)]
|
||||
interface nsIXULRuntime : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -104,6 +104,13 @@ interface nsIXULRuntime : nsISupports
|
||||
*/
|
||||
readonly attribute boolean accessibilityEnabled;
|
||||
|
||||
/**
|
||||
* This returns a very rough approximation of whether IME is likely
|
||||
* to be used for the browser session. DO NOT USE! This is temporary
|
||||
* and will be removed.
|
||||
*/
|
||||
readonly attribute boolean keyboardMayHaveIME;
|
||||
|
||||
/**
|
||||
* Signal the apprunner to invalidate caches on the next restart.
|
||||
* This will cause components to be autoregistered and all
|
||||
|
Loading…
Reference in New Issue
Block a user