summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-06-15 01:09:36 (GMT)
committerhobbs <hobbs>2002-06-15 01:09:36 (GMT)
commit8413e8324d73fc51be15fdcbdd93f6a1bac90ae0 (patch)
tree6ef8952ae7ba141ba39a22f140f638515ab7bdcc /unix
parent5c1e5bf298b329ec7a45cd601f6b4b208b24411b (diff)
downloadtk-8413e8324d73fc51be15fdcbdd93f6a1bac90ae0.zip
tk-8413e8324d73fc51be15fdcbdd93f6a1bac90ae0.tar.gz
tk-8413e8324d73fc51be15fdcbdd93f6a1bac90ae0.tar.bz2
* generic/tkEvent.c (Tk_HandleEvent):
* unix/tkUnixEvent.c (OpenIM): * unix/tkUnixKey.c (TkpGetString): * generic/tkInt.h: added TK_USE_XIM_SPOT flag bit for TkDisplay and used this to allow a runtime check to see if over-the-spot XIM is possible. If not it will try and fallback to the old-style input context, which handles things like dead keys input.
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixEvent.c21
-rw-r--r--unix/tkUnixKey.c14
2 files changed, 23 insertions, 12 deletions
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 097a0f1..bbf3455 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.6 2002/04/12 10:20:05 hobbs Exp $
+ * RCS: @(#) $Id: tkUnixEvent.c,v 1.7 2002/06/15 01:09:36 hobbs Exp $
*/
#include "tkInt.h"
@@ -583,14 +583,23 @@ OpenIM(dispPtr)
NULL) != NULL) || (stylePtr == NULL)) {
goto error;
}
+#if TK_XIM_SPOT
+ /*
+ * If we want to do over-the-spot XIM, we have to check that this
+ * mode is supported. If not we will fall-through to the check below.
+ */
for (i = 0; i < stylePtr->count_styles; i++) {
if (stylePtr->supported_styles[i]
-#if TK_XIM_SPOT
- == (XIMPreeditPosition | XIMStatusNothing)
-#else
- == (XIMPreeditNothing | XIMStatusNothing)
+ == (XIMPreeditPosition | XIMStatusNothing)) {
+ dispPtr->flags |= TK_USE_XIM_SPOT;
+ XFree(stylePtr);
+ return;
+ }
+ }
#endif
- ) {
+ for (i = 0; i < stylePtr->count_styles; i++) {
+ if (stylePtr->supported_styles[i]
+ == (XIMPreeditNothing | XIMStatusNothing)) {
XFree(stylePtr);
return;
}
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c
index 3f74a8d..5c01d46 100644
--- a/unix/tkUnixKey.c
+++ b/unix/tkUnixKey.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: tkUnixKey.c,v 1.6 2002/04/05 08:38:41 hobbs Exp $
+ * RCS: @(#) $Id: tkUnixKey.c,v 1.7 2002/06/15 01:09:36 hobbs Exp $
*/
#include "tkInt.h"
@@ -123,11 +123,13 @@ TkpGetString(winPtr, eventPtr, dsPtr)
/*
* Adjust the XIM caret position.
*/
- spot.x = caretX; spot.y = caretY;
- preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);
- XSetICValues(winPtr->inputContext,
- XNPreeditAttributes, preedit_attr, NULL);
- XFree(preedit_attr);
+ if (winPtr->dispPtr->flags & TK_USE_XIM_SPOT) {
+ spot.x = caretX; spot.y = caretY;
+ preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);
+ XSetICValues(winPtr->inputContext,
+ XNPreeditAttributes, preedit_attr, NULL);
+ XFree(preedit_attr);
+ }
#endif
} else {
len = XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf),