changeset 13227:d8af44485b3c

(x_window, both versions): Add HAVE_X_I18N support.
author Richard M. Stallman <rms@gnu.org>
date Sun, 15 Oct 1995 15:17:33 +0000
parents 3b15cf8aa50d
children a4a1d7df2e7f
files src/xfns.c
diffstat 1 files changed, 44 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Sun Oct 15 15:17:01 1995 +0000
+++ b/src/xfns.c	Sun Oct 15 15:17:33 1995 +0000
@@ -2581,6 +2581,28 @@
   class_hints.res_class = EMACS_CLASS;
   XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints);
 
+#ifdef HAVE_X_I18N
+  { 
+    XIM xim;
+    XIC xic = NULL;
+
+    xim = XOpenIM (FRAME_X_DISPLAY (f), NULL, NULL, NULL);
+
+    if (xim)
+      {
+	xic = XCreateIC (xim,  
+			 XNInputStyle,   XIMPreeditNothing | XIMStatusNothing,
+			 XNClientWindow, FRAME_X_WINDOW(f),
+			 XNFocusWindow,  FRAME_X_WINDOW(f),
+			 NULL);
+
+	if (xic == 0)
+	  XCloseIM (xim);
+      }
+    FRAME_XIC (f) = xic;
+  }
+#endif
+
   f->output_data.x->wm_hints.input = True;
   f->output_data.x->wm_hints.flags |= InputHint;
   XSetWMHints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
@@ -2672,6 +2694,28 @@
 		     InputOutput, /* class */
 		     FRAME_X_DISPLAY_INFO (f)->visual,
 		     attribute_mask, &attributes);
+#ifdef HAVE_X_I18N
+  { 
+    XIM xim;
+    XIC xic = NULL;
+
+    xim = XOpenIM (FRAME_X_DISPLAY(f), NULL, NULL, NULL);
+
+    if (xim)
+      {
+	xic = XCreateIC (xim,  
+			 XNInputStyle,   XIMPreeditNothing | XIMStatusNothing,
+			 XNClientWindow, FRAME_X_WINDOW(f),
+			 XNFocusWindow,  FRAME_X_WINDOW(f),
+			 NULL);
+
+	if (!xic)
+	  XCloseIM (xim);
+      }
+
+    FRAME_XIC (f) = xic;
+  }
+#endif
 
   validate_x_resource_name ();