6789984: JPasswordField can not receive keyboard input
authoralitvinov
Wed, 14 Nov 2012 18:40:05 +0400
changeset 14498 317e4103662e
parent 14497 e2413038bfbc
child 14499 3f36647a27f4
6789984: JPasswordField can not receive keyboard input Reviewed-by: naoto, anthony
jdk/src/share/classes/sun/awt/im/InputContext.java
jdk/src/share/classes/sun/awt/im/InputMethodAdapter.java
jdk/src/solaris/classes/sun/awt/X11InputMethod.java
--- a/jdk/src/share/classes/sun/awt/im/InputContext.java	Wed Nov 14 11:37:09 2012 +0000
+++ b/jdk/src/share/classes/sun/awt/im/InputContext.java	Wed Nov 14 18:40:05 2012 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -786,7 +786,7 @@
     public void disableNativeIM() {
         InputMethod inputMethod = getInputMethod();
         if (inputMethod != null && inputMethod instanceof InputMethodAdapter) {
-            ((InputMethodAdapter)inputMethod).disableInputMethod();
+            ((InputMethodAdapter)inputMethod).stopListening();
         }
     }
 
--- a/jdk/src/share/classes/sun/awt/im/InputMethodAdapter.java	Wed Nov 14 11:37:09 2012 +0000
+++ b/jdk/src/share/classes/sun/awt/im/InputMethodAdapter.java	Wed Nov 14 18:40:05 2012 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -79,7 +79,6 @@
 
     /**
      * Informs the input method adapter not to listen to the native events.
-     * This method is called when a Java input method is active.
      */
     protected void stopListening() {
         // ignore - adapters can override if needed
--- a/jdk/src/solaris/classes/sun/awt/X11InputMethod.java	Wed Nov 14 11:37:09 2012 +0000
+++ b/jdk/src/solaris/classes/sun/awt/X11InputMethod.java	Wed Nov 14 18:40:05 2012 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -415,6 +415,10 @@
             setXICFocus(getPeer(lastXICFocussedComponent), false, isLastXICActive);
             lastXICFocussedComponent = null;
             isLastXICActive = false;
+
+            resetXIC();
+            needResetXICClient = null;
+            needResetXIC = false;
         }
     }