Skip to content

Commit ce98054

Browse files
committed
Tweak to satisfy system test.
1 parent 43a4e6c commit ce98054

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

modules/javafx.graphics/src/main/java/com/sun/javafx/scene/InputMethodStateManager.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,16 @@ public void removeScene(Scene scene) {
126126
* Every Scene must call this before the focusOwner changes.
127127
*/
128128
public void focusOwnerWillChangeForScene(Scene scene) {
129-
if (scene == currentEventScene) {
129+
/**
130+
* Calling finishInputMethodComposition is only necessary if there's a
131+
* node that accepts IM events. But there's a system test that
132+
* expects finishInputMethodComposition to be called whenever the
133+
* focusOwner changes. To satisfy this test we call
134+
* finishInputMethodComposition even if no IM is enabled
135+
* (so currentEventScene will be null). This will be no-op as far as
136+
* the OS is concerned.
137+
*/
138+
if (scene == currentEventScene || currentEventScene == null) {
130139
Scene root = rootScene.get();
131140
if (root != null) {
132141
SceneHelper.finishInputMethodComposition(root);

0 commit comments

Comments
 (0)