summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixEvent.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2006-01-20 18:58:55 (GMT)
committerjenglish <jenglish@flightlab.com>2006-01-20 18:58:55 (GMT)
commit4ea1e3209f9603dd431f9fb3abee8f4098ae27f1 (patch)
treec33f09cc9873b7afe89e2226c42e852abf3a4d69 /unix/tkUnixEvent.c
parent81f1e32f9fc5bd5badc575ff2410440382e87181 (diff)
downloadtk-4ea1e3209f9603dd431f9fb3abee8f4098ae27f1.zip
tk-4ea1e3209f9603dd431f9fb3abee8f4098ae27f1.tar.gz
tk-4ea1e3209f9603dd431f9fb3abee8f4098ae27f1.tar.bz2
XIM fixes [See #905830, patch tk84-xim-fixes.patch].
+ Revert 2005-12-05 patch disabling XIM when SCIM in use; + Make sure all X events get passed to XFilterEvent, including those without a corresponding Tk window.
Diffstat (limited to 'unix/tkUnixEvent.c')
-rw-r--r--unix/tkUnixEvent.c42
1 files changed, 12 insertions, 30 deletions
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index d312997..500b447 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.19 2005/12/07 17:32:52 hobbs Exp $
+ * RCS: @(#) $Id: tkUnixEvent.c,v 1.20 2006/01/20 18:58:55 jenglish Exp $
*/
#include "tkInt.h"
@@ -334,19 +334,22 @@ static void
TransferXEventsToTcl(
Display *display)
{
- int numFound;
XEvent event;
- numFound = QLength(display);
-
/*
- * Transfer events from the X event queue to the Tk event queue.
+ * Transfer events from the X event queue to the Tk event queue
+ * after XIM event filtering. KeyPress and KeyRelease events
+ * are filtered in Tk_HandleEvent instead of here, so that Tk's
+ * focus management code can redirect them.
*/
-
- while (numFound > 0) {
+ while (QLength(display) > 0) {
XNextEvent(display, &event);
+ if (event.type != KeyPress && event.type != KeyRelease) {
+ if (XFilterEvent(&event, None)) {
+ continue;
+ }
+ }
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
- numFound--;
}
}
@@ -636,31 +639,10 @@ OpenIM(
{
unsigned short i;
XIMStyles *stylePtr;
- char *modifiers;
- modifiers = XSetLocaleModifiers("");
- if (modifiers == NULL) {
+ if (XSetLocaleModifiers("") == 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 *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) {