Spurious "key_press_event" when focus on entry widget using LANG=th_TH.UTF-8

Bug #1848865 reported by Ratchanan Srirattanamet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTK+
Fix Released
Unknown
gtk+3.0 (Ubuntu)
New
Low
Unassigned

Bug Description

GTK+3 will emit spurious "key_press_event" if the focus is currently on "GtkEntry" and the locale is set to th_TH.UTF-8. This issue seems to disappear if the locale is set to something else (tested with C.UTF-8 and en_US.UTF-8), and the presence of iBus and gnome-shell affects this.

Step to reproduce:
1. Boot into Xubuntu. Install package "language-pack-th" (for locale) and "libgtk-3-dev" for compiling demo program.
2. Download & compile the demo program "gtk3-entry-keyboard-event" attached in this bug. (The program is licensed under MIT.)
3. Run the program with LANG=th_TH.UTF-8. The window will contain an input box on top and a button on the bottom.
4. Click in the input box, then press a key on the keyboard. The program will print one line for each "key_press_event" delivered to the window, with keyval and hardware_keycode.

Expected result: only a single line is printed. For example for "a": "window: 0x0061 0x0026"

Actual result:
  - With LANG=th_TH.UTF-8, two lines are printed. The first line is the above line, while the second line has both values as zero: "window: 000000 000000"
  - If, instead, the locale is LANG=C.UTF-8, the program will print only one line as expected.
  - If iBus is installed and enabled, then 2 lines are printed with both lines containing the same code, no matter which locale it runs under.
  - If this same program is run in Gnome-based Ubuntu session, then only one line is printed no matter which locale it runs under.

This program is tested on Fedora and Manjaro with the correct result. Thus, this issue is Ubuntu-specific.

I've tested it on Ubuntu 19.10 with pretty much the same result, except the iBus case is now working correctly.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libgtk-3-0 3.22.30-1ubuntu4
ProcVersionSignature: Ubuntu 4.15.0-65.74-generic 4.15.18
Uname: Linux 4.15.0-65-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
CurrentDesktop: XFCE
Date: Sat Oct 19 18:06:23 2019
InstallationDate: Installed on 2018-05-03 (533 days ago)
InstallationMedia: Xubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: gtk+3.0
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ratchanan Srirattanamet (peat-new) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you report that upstream on https://gitlab.gnome.org/GNOME/gtk/issues ?

Changed in gtk+3.0 (Ubuntu):
importance: Undecided → Low
Revision history for this message
Ratchanan Srirattanamet (peat-new) wrote :

I'll report this upstream. However, as I cannot reproduce it on other distros, this might as well be an Ubuntu-specific bug.

Changed in gtk:
status: Unknown → New
Changed in gtk:
status: New → Fix Released
Revision history for this message
Ratchanan Srirattanamet (peat-new) wrote :

After mentioning that I cannot reproduce the problem on Fedora and Manjaro, they replied that this is probably the Ubuntu-specific bug and promptly closed the bug. Note that the status from Bug Watcher updater is incorrect.

Revision history for this message
Sebastien Bacher (seb128) wrote :

So it works under GNOME/the default Ubuntu session but is only an issue under xubuntu? Did you try the xfce remix from those other distributions? Is IBUS maybe active on some distributions and not others?

Revision history for this message
Ratchanan Srirattanamet (peat-new) wrote :

Sorry for the delay. This has fallen through the crack.

I've, in fact, reduced the testing environment down to just X, twm, and xterm and the bug is still reproducible. Also, I've tested it on Fedora 31 XFCE spin, and cannot reproduce it.

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.