summaryrefslogtreecommitdiffstats
path: root/generic/tkEvent.c
diff options
context:
space:
mode:
authorrmax <rmax>2004-11-11 11:33:55 (GMT)
committerrmax <rmax>2004-11-11 11:33:55 (GMT)
commitd115469e426e53a52abf2cea282f2a5ae43ba689 (patch)
treec3499ab39181618f14147f8ed8ed0e2097b9ae7c /generic/tkEvent.c
parentcb9e8849404eb0054d87ee2a6e8ed8665401b5c7 (diff)
downloadtk-d115469e426e53a52abf2cea282f2a5ae43ba689.zip
tk-d115469e426e53a52abf2cea282f2a5ae43ba689.tar.gz
tk-d115469e426e53a52abf2cea282f2a5ae43ba689.tar.bz2
* generic/tkEvent.c (InvokeInputMethods): Call XSetICFocus
whenever the window receives focus. This fixes bug #905830 but avoids #1000051.
Diffstat (limited to 'generic/tkEvent.c')
-rw-r--r--generic/tkEvent.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index 3b4b5a1..bb09034 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -12,7 +12,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.25 2004/08/29 09:27:35 dkf Exp $
+ * RCS: @(#) $Id: tkEvent.c,v 1.26 2004/11/11 11:33:56 rmax Exp $
*/
#include "tkPort.h"
@@ -390,6 +390,11 @@ CreateXIMSpotMethods(winPtr)
* insist. Create the input context for the window if
* it hasn't already been done (XFilterEvent needs this
* context).
+ *
+ * When the event is a FocusIn event, set the input context
+ * focus to the receiving window. This is needed for certain
+ * versions of Solaris, but we are still not sure whether it
+ * is being done in the right way.
*
* Results:
* 1 when we are done with the event.
@@ -408,8 +413,8 @@ InvokeInputMethods(winPtr,eventPtr)
{
TkDisplay *dispPtr = winPtr->dispPtr;
if ((dispPtr->flags & TK_DISPLAY_USE_IM)) {
+ long im_event_mask = 0L;
if (!(winPtr->flags & (TK_CHECKED_IC|TK_ALREADY_DEAD))) {
- long im_event_mask = 0L;
winPtr->flags |= TK_CHECKED_IC;
if (dispPtr->inputMethod != NULL) {
#if TK_XIM_SPOT
@@ -425,14 +430,15 @@ InvokeInputMethods(winPtr,eventPtr)
NULL);
#endif
}
- if (winPtr->inputContext != NULL) {
- XGetICValues(winPtr->inputContext,
- XNFilterEvents, &im_event_mask, NULL);
- if (im_event_mask != 0L) {
- XSelectInput(winPtr->display, winPtr->window,
- winPtr->atts.event_mask | im_event_mask);
- XSetICFocus(winPtr->inputContext);
- }
+ }
+ if (winPtr->inputContext != NULL &&
+ (eventPtr->xany.type == FocusIn)) {
+ XGetICValues(winPtr->inputContext,
+ XNFilterEvents, &im_event_mask, NULL);
+ if (im_event_mask != 0L) {
+ XSelectInput(winPtr->display, winPtr->window,
+ winPtr->atts.event_mask | im_event_mask);
+ XSetICFocus(winPtr->inputContext);
}
}
if (XFilterEvent(eventPtr, None)) {