Cursor jumps to start of doc when typing immediately after layout change
What Happened
When switching between two xkb keyboard sources (tried 'gb'/'fr' and 'gb'/'ru') the cursor jumps to the start of the document and the previously typed character is lost if a character is typed too rapidly after pressing the layout-change shortcut (used <Alt><Shift> and <LeftShift><RightShift>)
Expected Behavior
The layout should change and the the appropriate character entered into the text at the current position.
Steps to Reproduce
- Set up two keyboard layouts using System Settings (I also removed any ibus methods)
- Open a new document in Code and enter several blank lines.
- Repeatly alternate a key that generates a different character in the two layouts with a layout-change shortcut.
- After one or two layout switches the text entry point jumps to the start of the document.
Platform Information
Elementary 6.0 in VirtualBox VM. It does not seem to happen when Code is run in Ubuntu Focal (Gnome) so may not be a Code issue. Please move issue as required if confirmed to occur with Elementary 6.0 on bare metal.
I might need to file a new bug because it may be different but I'm experiencing sporadic cursor jumps to the top of the document as well.
Unfortunately, I cannot reproduce it consistently, although it tends to happen in clusters (i.e. it will jump back to the top four or five times in a minute and then it'll be alright for hours). I'm not switching keyboard layouts or anything out of the ordinary.
I'm on Fedora 34, Gnome 40, using the flatpak version of Code. However, I have been experiencing the same problem for a long time, at least on Fedora 32 and Fedora 33, as well as those versions of Gnome.