Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2230440

Summary: Direct input in Tk with XMODIFIERS can get scrambled (out of order) sometimes
Product: Red Hat Enterprise Linux 8 Reporter: Steve Barcomb <sbarcomb>
Component: ibusAssignee: fujiwara <tfujiwar>
Status: CLOSED MIGRATED QA Contact: QE Internationalization Bugs <qe-i18n-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 8.8CC: eng-i18n-bugs, tpopela
Target Milestone: rcKeywords: MigratedToJIRA, Reopened
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-05 16:17:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Steve Barcomb 2023-08-09 12:45:35 UTC
This is a continuation of the issue found https://bugzilla.redhat.com/show_bug.cgi?id=2170830#c52 

Sample program to reproduce the issue:

#!/usr/bin/perl
use strict;
use warnings;
use Tk;

# Create the main window
my $window = MainWindow->new;
$window->title("Input Dialog");

# Create a label to display the instructions
$window->Label(-text => "Enter your input:")->pack;

# Create an entry widget to input the text
my $entry = $window->Entry->pack;

# Create a button to submit the input
$window->Button(
    -text    => "Submit",
    -command => sub {
        my $input = $entry->get;  # Get the input from the entry widget
        print "Input: $input\n";  # Print the input to the console
        $window->destroy;         # Close the window
    }
)->pack;

# Run the Tk event loop
MainLoop;


Setting XMODIFIERS=@im=ibus works around the issue for now.

Comment 1 fujiwara 2023-08-10 02:05:13 UTC
(In reply to Steve Barcomb from comment #0)
> Setting XMODIFIERS=@im=ibus works around the issue for now.

Seems you use a simple X11 application.
IBus provides the plugin of X11, GTK or QT so if you don't set XMODIFIERS=@im=ibus, your application does not connect to IBus and your issue is not IBus.

Comment 5 Jens Petersen 2023-08-21 13:46:07 UTC
(In reply to Steve Barcomb from comment #0)
:
> Setting XMODIFIERS=@im=ibus works around the issue for now.

I think from https://bugzilla.redhat.com/show_bug.cgi?id=2170830#c38 you meant unsetting XMODIFIERS (or to "@im=none").

Comment 6 Jens Petersen 2023-08-21 14:53:36 UTC
Okay I managed to reproduce - one has to repeat maybe times into the widget (no need to press Submit):

Testing in RHEL 8 Gnome Wayland with unfixed mutter:

1) In one terminal start tk:

$ perl test.pl

and click on the tk input box to focus it.

2) In second terminal (https://bugzilla.redhat.com/show_bug.cgi?id=2170830#c51):

$ sudo evemu-play ./log.txt

3) Immediately press Alt-Tab to switch focus to the tk window.

"2lhq-returns" is output immediately in the shell but the rest of the input will get into the app.

Sometimes (maybe 1 in 10 times or less) the input will be jumbled:
keeping entering a key into the shell after seeing "Hit enter to start replaying", repeating this step 3, until seeing misordered text.


example result text in the input box:

@team-rocalklanet#1alklanet#1alklanet#1@team-rocalklanet#1alklanet#1alklanet#1alklanet#1alklanet#1@team-rocalklanet#1alkl1net#aalklanet#1@lhq-returns@team-rocalklanet#1alklanet#1alklanet#1@team-rocalklanet#1alklanet#1alklanet#1@team-rocalkl1net#aalklanet#1alklanet#1

Search this comment for "alklanet#1" to misorderings.

Comment 8 Jens Petersen 2023-08-21 14:57:13 UTC
After unsetting XMODIFIERS and rerunning the tk app, I couldn't reproduce yet

Comment 9 Jens Petersen 2023-08-24 08:00:57 UTC
I also reproduced in current Rawhide (ibus-1.5.9~rc1) and F38 (1.5.28-6).
It seems easier to reproduce in Fedora than RHEL8 for me.

Comment 10 Jens Petersen 2023-08-24 08:30:44 UTC
I opened an upstream issue for this: https://github.com/ibus/ibus/issues/2560

Comment 12 RHEL Program Management 2023-09-05 16:16:02 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 13 RHEL Program Management 2023-09-05 16:17:30 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.