Can't input in Entry (conflict with XIM)

Bug #283806 reported by Mingming Ren
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
perl-tk (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: perl-tk

I have the newest perl-tk package installed in intrepid.
I'm using SCIM as the input method. Sometimes I can't input using keyboard in Entry. I searched and finally got the answer. The perl-tk conflict with the XIM. I also found this solution via google. It works for me. Hope this patch could be accepted.

--- pTk/mTk/generic/tkEvent.c 2008-09-05 13:29:48.000000000 +0800
+++ pTk/mTk/generic/tkEvent.c 2008-09-05 13:17:24.000000000 +0800
@@ -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 */
--- pTk/mTk/unix/tkUnixEvent.c 2008-09-05 13:29:50.000000000 +0800
+++ pTk/mTk/unix/tkUnixEvent.c 2008-09-05 13:20:35.000000000 +0800
@@ -308,19 +308,18 @@
 TransferXEventsToTcl(display)
     Display *display;
 {
- int numFound;
     XEvent event;

- numFound = QLength(display);
-
     /*
      * Transfer events from the X event queue to the Tk event queue.
      */

- 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--;
     }
 }

Revision history for this message
Mingming Ren (portis25) wrote :

Fixed in upstream

Changed in perl-tk (Ubuntu):
status: New → Fix Released
Revision history for this message
Peter Jakobi (jakobi) wrote :

a quick workaround as given on https://bugzilla.redhat.com/show_bug.cgi?id=489228

export XMODIFIERS="" disables some input methods, but allows perl-tk to
see normal keyboard input.

That way at least apps like the perl tk debugger (libdevel-ptkdb-perl) are usable again.

(strangely, for multiline edit windows, the bug did not trigger.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.