8072448: Can not input Japanese in JTextField on RedHat Linux
authorazvegint
Fri, 15 May 2015 14:18:20 +0300
changeset 30935 420ca907dd33
parent 30934 b9fb91f448aa
child 30936 1a5cd4009d37
8072448: Can not input Japanese in JTextField on RedHat Linux Reviewed-by: alexsch, serb
jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c	Thu May 14 18:23:39 2015 +0300
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c	Fri May 15 14:18:20 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -904,7 +904,6 @@
 static Bool
 createXIC(JNIEnv * env, X11InputMethodData *pX11IMData, Window w)
 {
-    XIC active_ic, passive_ic;
     XVaNestedList preedit = NULL;
     XVaNestedList status = NULL;
     XIMStyle on_the_spot_styles = XIMPreeditCallbacks,
@@ -974,6 +973,12 @@
     }
 
     if (active_styles == on_the_spot_styles) {
+        pX11IMData->ic_passive = XCreateIC(X11im,
+                                   XNClientWindow, w,
+                                   XNFocusWindow, w,
+                                   XNInputStyle, passive_styles,
+                                   NULL);
+
         callbacks = (XIMCallback *)malloc(sizeof(XIMCallback) * NCALLBACKS);
         if (callbacks == (XIMCallback *)NULL)
             return False;
@@ -1024,12 +1029,6 @@
                                               NULL);
         XFree((void *)preedit);
 #endif /* __linux__ || MACOSX */
-        pX11IMData->ic_passive = XCreateIC(X11im,
-                                           XNClientWindow, w,
-                                           XNFocusWindow, w,
-                                           XNInputStyle, passive_styles,
-                                           NULL);
-
     } else {
         pX11IMData->ic_active = XCreateIC(X11im,
                                           XNClientWindow, w,