changeset 5502:580e399d49a5

6789984: JPasswordField can not receive keyboard input Reviewed-by: naoto, anthony
author alitvinov
date Tue, 27 Nov 2012 16:11:59 +0400
parents bcba89ce0a8c
children 6efc4363f909
files src/share/classes/sun/awt/im/InputContext.java src/share/classes/sun/awt/im/InputMethodAdapter.java src/solaris/classes/sun/awt/X11InputMethod.java
diffstat 3 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/awt/im/InputContext.java	Tue Nov 27 09:23:54 2012 +0100
+++ b/src/share/classes/sun/awt/im/InputContext.java	Tue Nov 27 16:11:59 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
@@ -785,7 +785,7 @@
     public void disableNativeIM() {
         InputMethod inputMethod = getInputMethod();
         if (inputMethod != null && inputMethod instanceof InputMethodAdapter) {
-            ((InputMethodAdapter)inputMethod).disableInputMethod();
+            ((InputMethodAdapter)inputMethod).stopListening();
         }
     }
 
--- a/src/share/classes/sun/awt/im/InputMethodAdapter.java	Tue Nov 27 09:23:54 2012 +0100
+++ b/src/share/classes/sun/awt/im/InputMethodAdapter.java	Tue Nov 27 16:11:59 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/src/solaris/classes/sun/awt/X11InputMethod.java	Tue Nov 27 09:23:54 2012 +0100
+++ b/src/solaris/classes/sun/awt/X11InputMethod.java	Tue Nov 27 16:11:59 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;
         }
     }