Bug 487332

Summary: Delayed rendering of typed characters and lost key presses in foot terminal emulator.
Product: [Plasma] kwin Reporter: Denis <foxy4>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: 5.27.11   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.0
Sentry Crash Report:
Attachments: Slow rendering
Lost backspace key
Also rendering bug present when launching yazi - missing portion of files
Artifacts from previosly viewed sixel image

Description Denis 2024-05-21 17:28:28 UTC
Created attachment 169681 [details]
Slow rendering

SUMMARY
When typing in a terminal window (specifically with foot), there is a noticeable delay before the typed characters are rendered on the screen. The delay is more pronounced when resizing the terminal window, such as when adjusting a tmux pane. Additionally, I have observed that sometimes the backspace key press is not registered, resulting in characters not being deleted. This is evident in the Wayland debug logs, where the backspace key press only generates a release event (wl_keyboard@20.key(129094, 261421545, 14, 0)) without a corresponding press event.

I have reported it to foot author who concluded that the issue is probably with the compositor. Here's the issue https://codeberg.org/dnkl/foot/issues/1705

STEPS TO REPRODUCE key not being registered
1. Install foot
2. Type a string
3. Try to remove a character. Sometimes it will not do it.

STEPS TO REPRODUCE delayed rendering
1. Install foot
2. Either launch a tmux with several panes and a program like htop running or simulate some constant output and try to resize the window.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 39
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12
Kernel Version: 6.8.8-200.fc39.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700G with Radeon Graphics
Memory: 23,3 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 Denis 2024-05-21 17:29:18 UTC
Created attachment 169682 [details]
Lost backspace key
Comment 2 Denis 2024-05-21 17:52:57 UTC
Created attachment 169683 [details]
Also rendering bug present when launching yazi - missing portion of files
Comment 3 Denis 2024-05-21 17:53:33 UTC
Created attachment 169684 [details]
Artifacts from previosly viewed sixel image
Comment 4 Denis 2024-05-21 17:57:44 UTC
I also added 2 screenshots with yazi file manager which has rendering artifacts cause it's probably the same type of issue related to kwin. Both yazi and foot render correctly under Sway.
Comment 5 Nate Graham 2024-05-22 19:06:13 UTC
Are you able to reproduce the issue in Plasma 6? 5 isn't being actively developed anymore. You can upgrade to Fedora 40 to get it..
Comment 6 Denis 2024-05-23 06:06:47 UTC
After upgrading to Plasma 6, the rendering artifacts with Yazi and the issue with pressed keys not being registered in Foot are no longer reproducible. However, the slow Foot resize issue when there is a constant output still occurs. I've tested this under nested Weston and observed the same problem, which suggests that it's not a KWin issue. Additionally, I've found that the slow tmux pane resize issue is present in all terminal emulators and Wayland compositors, and therefore not specific to KWin either. Based on these findings, I believe this issue can be safely closed.
Comment 7 Nate Graham 2024-05-23 16:13:33 UTC
Cool, thanks.