62 lines
1.6 KiB
Diff
62 lines
1.6 KiB
Diff
2009-03-19 Stepan Kasal <skasal@redhat.com>
|
|
|
|
Fix keyboard input with XIM, r12589 from
|
|
http://svn.perl.org/modules/Tk/trunk
|
|
|
|
Index: Tk/pTk/mTk/unix/tkUnixEvent.c
|
|
===================================================================
|
|
--- Tk/pTk/mTk/unix/tkUnixEvent.c (revision 12588)
|
|
+++ Tk/pTk/mTk/unix/tkUnixEvent.c (revision 12589)
|
|
@@ -305,22 +305,26 @@
|
|
*/
|
|
|
|
static void
|
|
-TransferXEventsToTcl(display)
|
|
- Display *display;
|
|
+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--;
|
|
}
|
|
}
|
|
|
|
Index: Tk/pTk/mTk/generic/tkEvent.c
|
|
===================================================================
|
|
--- Tk/pTk/mTk/generic/tkEvent.c (revision 12588)
|
|
+++ Tk/pTk/mTk/generic/tkEvent.c (revision 12589)
|
|
@@ -945,8 +945,10 @@
|
|
#endif
|
|
}
|
|
}
|
|
- if (XFilterEvent(eventPtr, None)) {
|
|
- goto done;
|
|
+ if (eventPtr->type == KeyPress || eventPtr->type == KeyRelease) {
|
|
+ if (XFilterEvent(eventPtr, None)) {
|
|
+ goto done;
|
|
+ }
|
|
}
|
|
}
|
|
#endif /* TK_USE_INPUT_METHODS */
|