changeset 1065:bd51a39469d7

Fixed RT-21659: Embedded : TextArea : Virtual keyboard doesn't go away.
author leifs
date Fri, 18 May 2012 11:55:21 -0700
parents 8ba525f169f9
children 5869b7d7eb0f
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextInputControlSkin.java
diffstat 1 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextInputControlSkin.java	Fri May 18 10:45:06 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextInputControlSkin.java	Fri May 18 11:55:21 2012 -0700
@@ -341,15 +341,14 @@
             textInput.focusedProperty().addListener(new InvalidationListener() {
                 @Override public void invalidated(Observable observable) {
                     if (useFXVK) {
-                        Platform.runLater(new Runnable() {
-                            public void run() {
-                                if (textInput.isFocused()) {
-                                    FXVK.attach(textInput);
-                                } else if (!(getScene().getFocusOwner() instanceof TextInputControl)) {
-                                    FXVK.detach();
-                                }
-                            }
-                        });
+                        if (textInput.isFocused()) {
+                            FXVK.attach(textInput);
+                        } else if (getScene() == null ||
+                                   getScene().getWindow() == null ||
+                                   !getScene().getWindow().isFocused() ||
+                                   !(getScene().getFocusOwner() instanceof TextInputControl)) {
+                            FXVK.detach();
+                        }
                     }
                 }
             });