diff options
author | rmax <rmax> | 2004-11-11 11:33:55 (GMT) |
---|---|---|
committer | rmax <rmax> | 2004-11-11 11:33:55 (GMT) |
commit | 35871a7064782cda8a3e9c75d86c2fc637694b66 (patch) | |
tree | c3499ab39181618f14147f8ed8ed0e2097b9ae7c /generic/tkEvent.c | |
parent | fa61ec1dd665487c5513d7db7255a2e09ed3e3e1 (diff) | |
download | tk-35871a7064782cda8a3e9c75d86c2fc637694b66.zip tk-35871a7064782cda8a3e9c75d86c2fc637694b66.tar.gz tk-35871a7064782cda8a3e9c75d86c2fc637694b66.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.c | 26 |
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)) { |