From df469dce8f4f4811e261db1dc4180b4e4932314e Mon Sep 17 00:00:00 2001 From: alitvinov Date: Wed, 14 Nov 2012 18:40:05 +0400 Subject: [PATCH] 6789984: JPasswordField can not receive keyboard input Reviewed-by: naoto, anthony --- src/share/classes/sun/awt/im/InputContext.java | 4 ++-- src/share/classes/sun/awt/im/InputMethodAdapter.java | 3 +-- src/solaris/classes/sun/awt/X11InputMethod.java | 6 +++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/share/classes/sun/awt/im/InputContext.java b/src/share/classes/sun/awt/im/InputContext.java index 27f05465d..1eccb6aa7 100644 --- a/src/share/classes/sun/awt/im/InputContext.java +++ b/src/share/classes/sun/awt/im/InputContext.java @@ -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 class InputContext extends java.awt.im.InputContext public void disableNativeIM() { InputMethod inputMethod = getInputMethod(); if (inputMethod != null && inputMethod instanceof InputMethodAdapter) { - ((InputMethodAdapter)inputMethod).disableInputMethod(); + ((InputMethodAdapter)inputMethod).stopListening(); } } diff --git a/src/share/classes/sun/awt/im/InputMethodAdapter.java b/src/share/classes/sun/awt/im/InputMethodAdapter.java index 0b5b02837..dfc31799b 100644 --- a/src/share/classes/sun/awt/im/InputMethodAdapter.java +++ b/src/share/classes/sun/awt/im/InputMethodAdapter.java @@ -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 @@ public abstract class InputMethodAdapter implements InputMethod { /** * 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 diff --git a/src/solaris/classes/sun/awt/X11InputMethod.java b/src/solaris/classes/sun/awt/X11InputMethod.java index ccfa51048..b2a62c60c 100644 --- a/src/solaris/classes/sun/awt/X11InputMethod.java +++ b/src/solaris/classes/sun/awt/X11InputMethod.java @@ -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 @@ public abstract class X11InputMethod extends InputMethodAdapter { setXICFocus(getPeer(lastXICFocussedComponent), false, isLastXICActive); lastXICFocussedComponent = null; isLastXICActive = false; + + resetXIC(); + needResetXICClient = null; + needResetXIC = false; } } -- GitLab