summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmax <rmax>2005-12-05 21:38:46 (GMT)
committerrmax <rmax>2005-12-05 21:38:46 (GMT)
commite0b6c2c00e0c074068259b2235d24b148e8c3e99 (patch)
treee99c1536e8d74658f1d03ad29a6998f79294c315
parent7ba82f81b2c0b50ebbf931956eca50643441f2c8 (diff)
downloadtk-e0b6c2c00e0c074068259b2235d24b148e8c3e99.zip
tk-e0b6c2c00e0c074068259b2235d24b148e8c3e99.tar.gz
tk-e0b6c2c00e0c074068259b2235d24b148e8c3e99.tar.bz2
Added a workaround for SCIM
-rw-r--r--ChangeLog7
-rw-r--r--unix/tkUnixEvent.c25
2 files changed, 30 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ffc7b01..3079556 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-05 Reinhard Max <max@tclers.tk>
+
+ * unix/tkUnixEvent.c (OpenIM): Added a workaround to allow at
+ least ASCII and the Compose key when typing into text and entry
+ widgets on a system that uses SCIM. This has to be taken out again
+ once the SCIM problems have been fixed.
+
2005-12-04 Daniel Steffen <das@users.sourceforge.net>
*** 8.4.12 TAGGED FOR RELEASE ***
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 34d9a69..3e66ba8 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixEvent.c,v 1.11.2.3 2004/10/27 00:37:38 davygrvy Exp $
+ * RCS: @(#) $Id: tkUnixEvent.c,v 1.11.2.4 2005/12/05 21:38:48 rmax Exp $
*/
#include "tkInt.h"
@@ -650,10 +650,31 @@ OpenIM(dispPtr)
{
unsigned short i;
XIMStyles *stylePtr;
+ char *modifiers;
- if (XSetLocaleModifiers("") == NULL) {
+ modifiers = XSetLocaleModifiers("");
+ if (modifiers == NULL) {
goto error;
}
+#if 1
+ /*
+ * This is a temporary hack that can be taken back out again
+ * once Tk has learned how to deal with SCIM
+ */
+ while ((modifiers = strchr(modifiers, '@')) != NULL) {
+ if (strncmp(modifiers, "@im=", 4) == 0) {
+ /* The first "@im=" entry wins */
+ const char const *scim = "@im=SCIM";
+ if (strncmp(modifiers, scim, strlen(scim)) == 0) {
+ /* If it is SCIM, we override it */
+ if (XSetLocaleModifiers("@im=local") == NULL) {
+ goto error;
+ }
+ }
+ break;
+ }
+ }
+#endif
dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL);
if (dispPtr->inputMethod == NULL) {