QTerminal drop-down shortcut with unmaped key breaks keyboard input

Bug #1915650 reported by Leonardo Gama
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
X.Org X server
New
Undecided
Unassigned
qterminal (Ubuntu)
New
Undecided
Unassigned

Bug Description

[Originally submitted to https://github.com/lxqt/qterminal/issues/794]

Setting the global shortcut of QTerminal drop-down to a (valid) key that isn't mapped to any physical key in the current keyboard layout (ex.: F13) makes QTerminal capture and consume all presses from all X windows(!).

Additionally, it seems that if the shortcut is set to an invalid value (ex.: "Spam") using the settings dialog, instead of causing an error, the shortcut is actually set to the Delete key.

These bugs happen on both X and Wayland sessions (with QTerminal running under XWayland in the latter case) and I was able to reproduce it on a different Ubuntu 20.04 machine. QTerminal devs (see link above) weren't able to reproduce using a newer release/different setup, though the code dealing with X11 global shortcut wasn't really modified in the last years.

# Expected Behavior

For the valid but unmapped key case, the shortcut would not work, of course. But QTerminal should not consume the keypresses.

For the invalid key case, it should show an error message on clicking "Apply" or "OK", don't register the shortcut and either undo the setting or clear the shortcut.

# Steps to Reproduce

1. Launch QTerminal in drop-down mode
2. Open Preferences > Dropdown > Shortcut
3. Set the global shortcut to a valid key that doesn't exist in the current keyboard layout (ex.: F13) and apply
4. Close the preferences dialog and try to type text in the terminal or any other program's window (it shouldn't work)
5. Open a "system monitor" using the mouse and kill the qterminal process (keyboard should start working again)
6. Map some key to the problematic key used in step (3) with xmodmap:
    $ xmodmap -e 'keysym Escape = F13'
7. Repeat the steps (1) to (4) and verify that the buggy behavior disappeared

# Context

I hit this problem after upgrading my system from 18.04 to 20.04. I have modified the layout file for the keyboard layout that I use to remap the Caps Lock key to Escape and the Escape key to F13, so that I could use it exclusively as a drop-down terminal shortcut. The upgrade overwrote the layout file and undid my modifications. I had QTerminal dropdown set as an startup app and, suddenly, when I logged in the first time after the upgrade, my keyboard didn't work anymore! It took me a couple days of tracking down to figure out that QTerminal was to blame, but at least it was easy to fix the problem.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: qterminal 0.14.1-0ubuntu2
ProcVersionSignature: Ubuntu 5.4.0-65.73-generic 5.4.78
Uname: Linux 5.4.0-65-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.16
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Sun Feb 14 11:31:03 2021
DistributionChannelDescriptor:
 # This is the distribution channel descriptor for the OEM CDs
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-bionic-amd64-20180608-47+loki-n3-v3-whl+X32
InstallationDate: Installed on 2021-01-05 (40 days ago)
InstallationMedia: Ubuntu 18.04 "Bionic" - Build amd64 LIVE Binary 20180608-09:38
SourcePackage: qterminal
UpgradeStatus: Upgraded to focal on 2021-02-10 (3 days ago)

Revision history for this message
Leonardo Gama (leo-gama) wrote :
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.