Bug 2089432 - Cursor jumping and hiding letters while typing in Electron apps under Wayland
Summary: Cursor jumping and hiding letters while typing in Electron apps under Wayland
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-server-Xwayland
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Olivier Fourdan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-23 16:21 UTC by somethingsomethingfedora
Modified: 2023-05-25 18:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-25 18:16:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
freedesktop.org Gitlab xorg xserver issues 1317 0 None opened xwayland glamor renders incorrectly on nvidia 2022-05-24 17:31:42 UTC

Description somethingsomethingfedora 2022-05-23 16:21:12 UTC
Description of problem:
Typing cursor jumps back and hides letters randomly while typing in Electron apps under Wayland

Version-Release number of selected component (if applicable):


How reproducible:
100% on wayland applications when typing a long string in an electron application

Steps to Reproduce:
1. Use Wayland (I use GNOME but not sure if that part is required)
2. Open an electron application like VS Code or discord
3. Type anywhere for a bit and observe cursor jumps

Actual results:
Cursor intermittently jumps back 1+ characters and hides the typed characters in the process

Expected results:
Cursor moves forward normally and does not jump back

Additional info:
I tried to record a video of this with the screenshot tool, but the recording does not show the behavior even though it occurred while recording.

Comment 1 Olivier Fourdan 2022-05-24 13:42:03 UTC
Wayland is just a set of protocol definitions and a small IPC library, so not "Wayland".

If anything that would be Xwayland as Electron apps run by default on X11, hence on Xwayland.

When you say "cursor jumps back", you mean the caret in the text widget?

I fail to see how Xwayland could be tampering with the caret in the application. I fail to reproduce the exact same behavior, however what I do see is a delayed update, the last character typed on the keyboard shows up after a 1 second delay, that would corroborate the fact that the issue doesn't show on the screencast (i.e. it's more of an app painting issue).

Comment 2 Olivier Fourdan 2022-05-24 13:52:40 UTC
Actually… I see something really weird now, like spurious key events when typing -relly- fast (regardless of VScode or Electro, I can even see that in weston-eventdemo).

Out of curiosity, mind trying to reproduce the issue in another Wayland compositor such as weston, sway or KDE Plasma Wayland?

Comment 3 somethingsomethingfedora 2022-05-24 15:08:51 UTC
Well, I installed weston and loaded into it and can't launch any of my apps without a seg fault.  I've tried installing Sway, but it just kicks me back to GDM when I try to login to it.

I did manage to get an external video of the behavior in GNOME though: https://imgur.com/a/uDvxi2Z

It gets even messier when you start trying to backspace, but I didn't want to add that in the video because it's hard to tell on video what is a backspace and what is this cursor jump bug since the letters also disappear for a moment with the bug.

The issue came up on the ask forums https://ask.fedoraproject.org/t/stuttering-keyboard-on-wayland/22718/4 and I've also discussed it in Discord previously with a couple other people that were able to confirm.

Comment 4 somethingsomethingfedora 2022-05-24 15:17:30 UTC
I just tested on KDE Plasma Wayland and the cursor does not visually show the jumping around, but instead just has an intermittent delay between cursor movements forwards and backwards. So letters won't show up for a bit and backspaced letters won't remove for a bit.

Comment 5 Olivier Fourdan 2022-05-24 15:23:13 UTC
Yeah, looking at the video I am now even more convinced this is a buffer update issue more than anything to do with keyboard. And that would possibly match what I was seeing.

Can you try something real quick?

In VScode, go to File → Preferences → Settings then expand the "Text Editor" section and click on cursor, and enable "Cursor Smooth Caret Animation" - Does that help?

Comment 6 somethingsomethingfedora 2022-05-24 15:33:09 UTC
Yes, it looks like that does fix it in VS Code.

Comment 7 Olivier Fourdan 2022-05-24 15:39:09 UTC
I'd say it's a workaround, not a fix. Similarly, disabling glamor support (XWAYLAND_NO_GLAMOR=1 in /etc/environment) also avoids the issue.

So I think the problem is with the present code in Xwayland, I reckon that 1 second delay is the present flip timer.

Comment 8 Olivier Fourdan 2022-05-24 16:33:42 UTC
Out of curiosity, is that with NVIDIA proprietary driver?

Comment 9 somethingsomethingfedora 2022-05-24 17:14:26 UTC
Yes it is with the NVIDIA proprietary driver

Comment 10 Olivier Fourdan 2022-05-24 17:31:43 UTC
(In reply to somethingsomethingfedora from comment #9)
> Yes it is with the NVIDIA proprietary driver

Ah right, that was a crucial piece of information missing :)

Then I think it's another effect of upstream bug https://gitlab.freedesktop.org/xorg/xserver/-/issues/1317 (fwiw, I fail to reproduce in intel using the open source stack).

Comment 11 Ben Cotton 2023-04-25 17:13:49 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 12 Ludek Smid 2023-05-25 18:16:05 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.