[patch] Disable ttyxi input processing under Wayland

Bug #2063919 reported by Unxed
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
far2l (Ubuntu)
Fix Released
Undecided
Dmitry Shachnev
Noble
Fix Committed
Undecided
Dmitry Shachnev

Bug Description

[ Impact ]

The response to keyboard button presses has a noticeable delay, and the ESC key has to be pressed twice. Bug reproduces only in Wayland sessions, but not in X11 sessions.

This seriously affects user experience, so fix should be backported to stable release.

Fix works as follows: far2l uses X11-specific technique to receive key combinations often not available in common terminal emulators, like Ctrl+0, and also to distinguish ESC key presses from char with code 27 sent to terminal. It is called ttyxi mode (xi for XInput it uses). But under Wayland this technique is not working due to Wayland security model, and also introduces delay bug. This patch disables this technique under Wayland, and enables other way for ESC key processing using delay measurement, like mc does.

[ Test plan ]

1. Install far2l in Ubuntu 24.04:
apt install far2l

2. Run far2l:
far2l

3. Press some keys to notice input delay; open any dialog (press F1 for example) and try to close it using ESC key to notice you should press it twice.

[ Where problems could occur ]

The fix is already in master branch of upstream far2l, it is also presents in far2l ppa and no problems were found during testing by enthusiasts. The only problem is extended key support will not work in common terminals, but is can not work under Wayland anyway. Still you can use kitty terminal emulator that has extended keyboard protocol allowing apps to receive any key combinations.

This patch (from upstream) fixes both issues (also attached as a file below):
https://patch-diff.githubusercontent.com/raw/elfmz/far2l/pull/2043.diff

far2l 2.6.1~beta+ds-1 from Debian already has similar fix applied.

[ Other info ]

The workaround is to run far2l as follows:
far2l --nodetect=xi --ee

First option, --nodetect=xi, disables ttyxi mode (it is X11-specific and can not operate under Wayland anyway). The second option enables ESC key processing using delays measurement, as it is done in mc.

In Noble + 1 this will be fixed by auto-sync of far2l 2.6.1~beta+ds-1 from Debian.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: far2l 2.6.0~beta+ds-1build2 [modified: usr/lib/far2l/far2l_ttyx.broker]
ProcVersionSignature: Ubuntu 6.8.0-31.31-generic 6.8.1
Uname: Linux 6.8.0-31-generic x86_64
ApportVersion: 2.28.1-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sat Apr 27 09:08:40 2024
InstallationDate: Installed on 2024-04-25 (1 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Release amd64 (20240424)
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: far2l
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Unxed (unxed) wrote :
Revision history for this message
Unxed (unxed) wrote (last edit ):

Patch file itself. Disables ttyxi input processing mode under Wayland fixing input delays and also enabling alternative ESC key processing mode using delays measurement as done in mc.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in far2l (Ubuntu):
status: New → Confirmed
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Can you please fill the bug description according to this template? https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

Then I will upload the fix to noble.

Changed in far2l (Ubuntu Noble):
assignee: nobody → Dmitry Shachnev (mitya57)
Unxed (unxed)
description: updated
description: updated
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "2043.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Unxed (unxed)
description: updated
Revision history for this message
Unxed (unxed) wrote :
Unxed (unxed)
description: updated
description: updated
description: updated
Revision history for this message
Lenin (gagarin) wrote :

@unxed this is fixed in debian unstable, right?

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Unxed, or anyone else affected,

Accepted far2l into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/far2l/2.6.0~beta+ds-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in far2l (Ubuntu Noble):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-noble
Revision history for this message
Unxed (unxed) wrote :

Hello, Timo.

Made some testing as you suggested. Removed all traces of old far2l package on the same machine by
sudo apt purge far2l

After it installed two deb files from -proposed:
https://launchpadlibrarian.net/727403730/far2l-data_2.6.0~beta+ds-1ubuntu0.1_all.deb
https://launchpadlibrarian.net/727403734/far2l_2.6.0~beta+ds-1ubuntu0.1_amd64.deb

Input delay has gone. Also ESC is now working even if pressed once. So the bug has gone! Thanks.

tags: added: verification-done-noble
removed: verification-needed-noble
Unxed (unxed)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

In Oracular, this was fixed in version 2.6.1~beta+ds-1 synced from Debian.

Changed in far2l (Ubuntu):
status: Confirmed → Fix Released
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.