Bug 1726138 - Tk::Text ignores non-ASCII input from a keyboard with SCIM input method
Summary: Tk::Text ignores non-ASCII input from a keyboard with SCIM input method
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-Tk
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Andreas Bierfert
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-02 08:15 UTC by Petr Pisar
Modified: 2019-11-27 22:58 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-27 22:58:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
CPAN 129962 0 None None None 2019-07-02 11:31:24 UTC

Description Petr Pisar 2019-07-02 08:15:31 UTC
This code:

#!/usr/bin/perl
use strict;
use warnings;
use Tk;
my $mw = MainWindow->new;
$mw->title ($]);
my $tw = $mw->Text (
    -font       => "{ DejaVu Sans Mono } 9",
    )->pack (-side => "top", -expand => 1, -fill => "both", -anchor => "nw");
MainLoop;

creates a text area widget where one can write a text as in a text editor.

If I press 'A' key, 'a' appears. That's fine.
If I press key that returns a non-ASCII character (e.g. '5' key on Czech keyboard should return 'ř' character), nothing shows.

I still can insert the non-ASCII characters from a primary X11 selection by pressing a middle mouse button. Thus I conclude perl-Tk ignores non-ASCII keys.

This happens with any perl-Tk-804.034 or perl-libs. Also upstream sources suffer from this. A previous perl-Tk-804.033 ignores all keys, including ASCII ones.

I guess something has changes in X11 and the bundled Tk does not process Unicode labels from the key press events.

Comment 1 Petr Pisar 2019-07-02 09:12:56 UTC
Actually it works unless an input method is used. If an input method is in use, XMODIFIERS environment variable is set (e.g. to "@im=SCIM" if scim input method is used). Then a branch for handling 'A' Tk::Ev events at pTk/tkBind.c:2925:

                    string = TkpGetString(winPtr, eventPtr, &buf);
                    numChars = Tcl_DStringLength(&buf);

obtains an empty string and returns an empty string back to Perl Tk.

If XMODIFIERS is unset, the code obtains at a second key event a correct two-byte string "ř".

Comment 2 Petr Pisar 2019-07-02 09:34:11 UTC
And that's caused by winPtr->inputContext being NULL in TkpGetString(). It seems that the inputContext is not properly initialized.

Comment 3 Petr Pisar 2019-07-02 11:03:42 UTC
The initiation happens in OpenIM() during an application startup:

  dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL);

and it fails.

Comment 4 Petr Pisar 2019-07-02 11:31:25 UTC
I created a ticket at upstream.

Comment 5 Ben Cotton 2019-10-31 19:04:57 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Ben Cotton 2019-11-27 22:58:56 UTC
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.