diff options
author | hobbs <hobbs> | 2002-06-15 01:09:36 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-06-15 01:09:36 (GMT) |
commit | 8413e8324d73fc51be15fdcbdd93f6a1bac90ae0 (patch) | |
tree | 6ef8952ae7ba141ba39a22f140f638515ab7bdcc /generic | |
parent | 5c1e5bf298b329ec7a45cd601f6b4b208b24411b (diff) | |
download | tk-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 'generic')
-rw-r--r-- | generic/tkEvent.c | 67 | ||||
-rw-r--r-- | generic/tkInt.h | 7 |
2 files changed, 40 insertions, 34 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 8ceb358..16d2215 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEvent.c,v 1.12 2002/06/15 00:21:42 hobbs Exp $ + * RCS: @(#) $Id: tkEvent.c,v 1.13 2002/06/15 01:09:36 hobbs Exp $ */ #include "tkPort.h" @@ -866,41 +866,42 @@ Tk_HandleEvent(eventPtr) winPtr->flags |= TK_CHECKED_IC; if (dispPtr->inputMethod != NULL) { #if TK_XIM_SPOT - XVaNestedList preedit_attr; - XPoint spot = {0, 0}; - - if (dispPtr->inputXfs == NULL) { - /* - * We only need to create one XFontSet - */ - char **missing_list; - int missing_count; - char *def_string; - - dispPtr->inputXfs = XCreateFontSet(dispPtr->display, - "-*-*-*-R-Normal--14-130-75-75-*-*", - &missing_list, &missing_count, &def_string); - if (missing_count > 0) { - XFreeStringList(missing_list); + if (dispPtr->flags & TK_USE_XIM_SPOT) { + XVaNestedList preedit_attr; + XPoint spot = {0, 0}; + + if (dispPtr->inputXfs == NULL) { + /* + * We only need to create one XFontSet + */ + char **missing_list; + int missing_count; + char *def_string; + + dispPtr->inputXfs = XCreateFontSet(dispPtr->display, + "-*-*-*-R-Normal--14-130-75-75-*-*", + &missing_list, &missing_count, &def_string); + if (missing_count > 0) { + XFreeStringList(missing_list); + } } - } - preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, - XNFontSet, dispPtr->inputXfs, NULL); - winPtr->inputContext = XCreateIC(dispPtr->inputMethod, - XNInputStyle, XIMPreeditPosition | XIMStatusNothing, - XNClientWindow, winPtr->window, - XNFocusWindow, winPtr->window, - XNPreeditAttributes, preedit_attr, - NULL); - XFree(preedit_attr); -#else - winPtr->inputContext = XCreateIC(dispPtr->inputMethod, - XNInputStyle, XIMPreeditNothing | XIMStatusNothing, - XNClientWindow, winPtr->window, - XNFocusWindow, winPtr->window, - NULL); + preedit_attr = XVaCreateNestedList(0, XNSpotLocation, + &spot, XNFontSet, dispPtr->inputXfs, NULL); + winPtr->inputContext = XCreateIC(dispPtr->inputMethod, + XNInputStyle, XIMPreeditPosition|XIMStatusNothing, + XNClientWindow, winPtr->window, + XNFocusWindow, winPtr->window, + XNPreeditAttributes, preedit_attr, + NULL); + XFree(preedit_attr); + } else #endif + winPtr->inputContext = XCreateIC(dispPtr->inputMethod, + XNInputStyle, XIMPreeditNothing|XIMStatusNothing, + XNClientWindow, winPtr->window, + XNFocusWindow, winPtr->window, + NULL); } } if (XFilterEvent(eventPtr, None)) { diff --git a/generic/tkInt.h b/generic/tkInt.h index 0849d7e..f0c80a3 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: $Id: tkInt.h,v 1.45 2002/06/15 00:21:42 hobbs Exp $ + * RCS: $Id: tkInt.h,v 1.46 2002/06/15 01:09:36 hobbs Exp $ */ #ifndef _TKINT @@ -499,9 +499,14 @@ typedef struct TkDisplay { /* * Flag values for TkDisplay flags. + * TK_DISPLAY_COLLAPSE_MOTION_EVENTS: (default on) + * Indicates that we should collapse motion events on this display + * TK_USE_INPUT_METHODS: (default off) + * Indicates that we should use over-the-spot XIM on this display */ #define TK_DISPLAY_COLLAPSE_MOTION_EVENTS (1 << 0) +#define TK_USE_XIM_SPOT (1 << 1) /* * One of the following structures exists for each error handler |