Blob Blame History Raw
--- tgif-QPL-4.1.44/convxim.c.orig	2005-01-15 09:26:19.000000000 +0900
+++ tgif-QPL-4.1.44/convxim.c	2007-04-06 23:50:33.000000000 +0900
@@ -69,6 +69,10 @@
 static Bool		_XIMErrorFlag = False;
 static Bool		overthespot = False;
 
+static Bool	modscim = False;
+static int	pre_x = 0;
+static int	pre_y = 0;
+
 #ifndef _NO_XIMP
 static MYIOErrHandler *_XipSetIOErrorHandler(new_handler)
     MYIOErrHandler *new_handler;
@@ -214,6 +218,14 @@
 	Msg(buf);
     }
 
+	for (i = 0; i <= (int)strlen(modifiers) - 4 ; i++) {
+		if (strncmp((char *)&modifiers[i], "SCIM", 4) == 0 ||
+		    strncmp((char *)&modifiers[i], "scim", 4) == 0) {
+			modscim = True;
+			break;
+		}
+	}
+
     if(im == NULL) {
 	im = XOpenIM(mainDisplay, NULL, NULL, NULL);
 	if(im == NULL) {
@@ -419,6 +431,9 @@
   }
   if (im == NULL || ic == NULL || !overthespot) return;
 
+  if (x == pre_x && y == pre_y) return;
+  pre_x = x; pre_y = y;
+
   if (XIMfs) XFreeFontSet(dpy, XIMfs);
   GetCurFontInfoStr(szAttemptedFontName, sizeof(szAttemptedFontName));
   XIMfs=XCreateFontSet(dpy, szAttemptedFontName,
@@ -442,7 +457,9 @@
 	       NULL);
   XFree(preedit_attr);
   XFree(status_attr);
-  XSetICFocus(ic);
+  if (!modscim) {
+    XSetICFocus(ic);
+  }
 }
 
 void XIMCleanUp()