1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-15 03:14:23 +00:00
freebsd-ports/chinese/tk83/files/patch-ak
Kevin Lo 2c54b710d9 Chineselized Tk ver. 8.3.0. This version is i18n improvement.
This changes the behavior of Tk on X where X Input Methods (XIM) were
recognized and used without question.
With 8.3, they will be recognized and initialized, but not used unless
XIM is turned on (tk useinputmethods 1).  This should only affect users
users with special input methods, and the new default behavior should
be more beneficial to the average user.

Please repo copy, thanks.
2001-02-22 04:09:59 +00:00

48 lines
1.4 KiB
Plaintext

--- ../generic/tkEvent.c.orig Thu Dec 16 21:57:36 1999
+++ ../generic/tkEvent.c Wed Feb 21 23:18:43 2001
@@ -663,6 +663,17 @@
}
#ifdef TK_USE_INPUT_METHODS
+#ifdef I18N_IMPROVE
+ /*
+ * No need to create an input context for each and every window.
+ *
+ * Futhermore, XFilterEvent() should be called just after the
+ * event is fetched, since some IM server have protocol bugs that
+ * causes Tk freezing, so events EXCEPT THE INPUT METHODS THINGS
+ * should only be queued into Tcl event queue.
+ *
+ */
+#else
/*
* Pass the event to the input method(s), if there are any, and
* discard the event if the input method(s) insist. Create the
@@ -684,6 +695,7 @@
goto done;
}
}
+#endif /* I18N_IMPROVE */
#endif /* TK_USE_INPUT_METHODS */
/*
@@ -936,6 +948,18 @@
break;
}
}
+
+#if defined(TK_USE_INPUT_METHODS) && defined(I18N_IMPROVE)
+ if (eventPtr->type == KeyPress && eventPtr->xkey.keycode == 0) {
+ /*
+ * No doubt this is a composed message from IM server.
+ * Tk can handle KeyPress event with zero keycode value
+ * if state of the event is zero.
+ */
+ eventPtr->xkey.state = 0;
+ dispPtr->isComposed = 1;
+ }
+#endif /* TK_USE_INPUT_METHODS && I18N_IMPROVE */
if ((dispPtr->delayedMotionPtr != NULL) && (position == TCL_QUEUE_TAIL)) {
if ((eventPtr->type == MotionNotify) && (eventPtr->xmotion.window