JRE-729 [windows] unreasonable IME activity consumes CPU

This commit is contained in:
Anton Tarasov
2018-04-17 19:55:03 +03:00
committed by alexey.ushakov@jetbrains.com
parent e3b8e2641b
commit fce6f2648c

View File

@@ -94,6 +94,10 @@ import javax.swing.JRootPane;
import sun.awt.AWTAccessor;
import sun.awt.AppContext;
import sun.awt.ComponentFactory;
import sun.security.action.GetBooleanAction;
import sun.security.action.GetPropertyAction;
import sun.awt.AppContext;
import sun.awt.AWTAccessor;
import sun.awt.ConstrainableGraphics;
import sun.awt.EmbeddedFrame;
import sun.awt.RequestFocusController;
@@ -640,6 +644,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
String s2 = java.security.AccessController.doPrivileged(
new GetPropertyAction("awt.image.redrawrate"));
incRate = (s2 != null) ? Integer.parseInt(s2) : 100;
@SuppressWarnings("removal")
boolean imeDisabled = java.security.AccessController.doPrivileged(new GetBooleanAction("awt.ime.disabled"));
INPUT_METHODS_DISABLED = imeDisabled;
}
/**
@@ -1641,6 +1649,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* @since 1.2
*/
public void enableInputMethods(boolean enable) {
if (INPUT_METHODS_DISABLED) return;
if (enable) {
if ((eventMask & AWTEvent.INPUT_METHODS_ENABLED_MASK) != 0)
return;
@@ -5160,6 +5169,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
}
boolean areInputMethodsEnabled() {
if (INPUT_METHODS_DISABLED) return false;
// in 1.2, we assume input method support is required for all
// components that handle key events, but components can turn off
// input methods by calling enableInputMethods(false).