summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmax <rmax>2005-12-05 17:02:00 (GMT)
committerrmax <rmax>2005-12-05 17:02:00 (GMT)
commit86480885c74b45e5064b4b9fe7ef7fa8a5d5bf0f (patch)
tree16b942623c898b58fece56aa6f0ce18962b9c7bc
parentc96bb297382ca81f2babbd35850fdb47b965d091 (diff)
downloadtk-86480885c74b45e5064b4b9fe7ef7fa8a5d5bf0f.zip
tk-86480885c74b45e5064b4b9fe7ef7fa8a5d5bf0f.tar.gz
tk-86480885c74b45e5064b4b9fe7ef7fa8a5d5bf0f.tar.bz2
* 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.
-rw-r--r--ChangeLog7
-rw-r--r--unix/tkUnixEvent.c25
2 files changed, 30 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 214e0cf..bef5787 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-05 Reinhard Max <max@suse.de>
+
+ * 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-01 Daniel Steffen <das@users.sourceforge.net>
* unix/tcl.m4 (Darwin): fixed error when MACOSX_DEPLOYMENT_TARGET unset
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 1ce015c..463db3a 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.17 2005/11/13 21:00:17 dkf Exp $
+ * RCS: @(#) $Id: tkUnixEvent.c,v 1.18 2005/12/05 17:02:02 rmax Exp $
*/
#include "tkInt.h"
@@ -636,10 +636,31 @@ OpenIM(
{
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) {