Bug 443977 - URGENT REGRESSION: unusable with non-english keyboard: adds space before every accented character
Summary: URGENT REGRESSION: unusable with non-english keyboard: adds space before ever...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 21.04.3
Platform: openSUSE Linux
: NOR critical
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 444473 445701 447584 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-10-18 14:36 UTC by php4fan
Modified: 2022-01-23 10:39 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
ibus-setup workaround (53.05 KB, image/png)
2021-12-28 02:32 UTC, Weng Xuetian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description php4fan 2021-10-18 14:36:24 UTC
SUMMARY


STEPS TO REPRODUCE
1. On a Spanish keyboard, hit the key "´" followed by an a
2. 
3. 

OBSERVED RESULT

Adds a space and then the character "á"

EXPECTED RESULT

Should only produce an "á" without adding a space before it.

Now it has become IMPOSSIBLE to type in Spanish.



Operating System: openSUSE Tumbleweed 20211008
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2
Kernel Version: 5.14.9-1-default (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
Memory: 7.3 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Plus Graphics
Comment 1 php4fan 2021-10-19 13:50:40 UTC
This persisted across reboot and restarting Kate a few times. 

Then, after a few hours leaving the computer unattended and locking and unlocking screen (and I'm not 100% sure if it goes to sleep but I don't think it does), it went away WITHOUT restarting Kate.

I'm starting to wonder if this is a variant of https://bugs.kde.org/show_bug.cgi?id=438820 / https://bugzilla.suse.com/show_bug.cgi?id=1187513
Comment 2 Christoph Cullmann 2021-10-19 17:49:35 UTC
I would assume so.
I have here a German keyboard and the á composition works in Kate.

Sorry that you have such issues, but that must be some issue on your distro, like you linked below.
Comment 3 php4fan 2021-10-29 15:06:54 UTC
Right now the ONLY application where I observe the issue is Kate.

The issue linked above had similar but different symptoms; it affected Kate and other applications, and I haven't been observing it for several weeks now. For all we know it could be unrelated and fixed.

An issue more similar to this one (than the one linked above) but not identical (specifically: accented characters being duplicated: I typed "á" I would get "áá") initially affected one other application (Telegram Desktop) and appeared at the same time as this one in Kate. Every time I observed one I would observe also the other, and when one went away the other did too. However, the issue in Telegram Desktop is gone now, but this one in Kate persists.

Any assumption about the different issues being related with one another is speculation.

The default assumption right now, until there's anything to suggest otherwise, should be that this is an issue in Kate, which is the only application where the issue is currently observed, and the only one where the issue *exactly as described here* has ever been observed. (that I know of, of course).
Comment 4 php4fan 2021-10-29 15:29:44 UTC
Here's something interesting.

If I restart the system with Kate open (which will cause it to be automatically open at startup), then composition in Kate will be broken in a different way, and typing accented characters will result in plain unaccented characters. E.g. "`"+"a"="a".

After that, if I restart Kate, then it start behaving as described in this report, that is, it will add a space before every accented character ("`"+"a"=" a").
Comment 5 Victor Sanchez 2021-10-29 20:54:27 UTC
I am seeing the same behavior in Kubuntu 21.10, plasma 5.23.3 in Wayland. The problem in my system happens for the "latam" layout (a variation of Spanish), the French layout, and the german layout when "dead" or composition keys are used. 

It affects other programs that inherit the kate part (develop, kile, e.g.) 

Christoph, are you working in X11 or Wayland?
Comment 6 Victor Sanchez 2021-10-29 21:00:26 UTC
(In reply to Victor Sanchez from comment #5)
> I am seeing the same behavior in Kubuntu 21.10, plasma 5.23.3 in Wayland.
> The problem in my system happens for the "latam" layout (a variation of
> Spanish), the French layout, and the german layout when "dead" or
> composition keys are used. 
> 
> It affects other programs that inherit the kate part (develop, kile, e.g.) 
> 
> Christoph, are you working in X11 or Wayland?

BTW, I am using kate from 21.08.2
Comment 7 Victor Sanchez 2021-10-30 16:07:35 UTC
Just to add, the problem is present both in X11 and Wayland. Only with Kate, Kwrite, and derivatives. 

Operating System: Kubuntu 21.10
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.13.0-20-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 8 Christoph Cullmann 2021-10-30 17:53:00 UTC
That means e.g. in other Qt powered things like QtCreator or let's say Konsole you can type without these issues?

I can't reproduce this either on X11 nor on Wayland.
Comment 9 Victor Sanchez 2021-10-30 19:14:31 UTC
(In reply to Christoph Cullmann from comment #8)
> That means e.g. in other Qt powered things like QtCreator or let's say
> Konsole you can type without these issues?
> 
> I can't reproduce this either on X11 nor on Wayland.

Correct. It works well in other KDE apps like Krita and konsole and in qt applications like QtCreator and texstudio... very strange! 

Do you need me to check something else?

This is my configuration, now running wayland:

Operating System: Kubuntu 21.10
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.13.0-20-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 10 Victor Sanchez 2021-10-30 19:24:59 UTC
The way it types is different: when typing a "dead" character in konsole nothing shows up until the following vowel appears, ie. typing "'" shows nothing until I press "a" creating "á" the expected result. 

When typing in kate, typing the "dead" character "'" shows the "´" and then when the vowel is typed the character is erased, the space is left, and the correct letter appears "á" but a space is left before.
Comment 11 Victor Sanchez 2021-10-30 19:40:59 UTC
If it is of any help, my distribution has libinput 1.18.1 and libudev 248.3-1ubuntu8 and libevdev2 1.11.0+dfsg-1build1
Comment 12 php4fan 2021-11-17 11:18:19 UTC
If you're not going to fix this anytime soon, please release an update that rolls everything back to the last version before the regression. Whatever improvements or even bugfixes there have been since them, there's no way they outweigh this. Kate is now completely unusable (unless you only write in English). The default text editor in many Linux distributions. Unusable.
Comment 13 Kåre Särs 2021-11-17 12:49:25 UTC
Hello php4fan@gmail.com

The problem here is that we do not know what the problem is or, if it is a Kate bug, when it has been introduced... how far back should be go?

Can this be reproduced on Kubuntu 20.10 does it reproduce on early Kubuntu 21.04?...
Comment 14 php4fan 2021-11-17 13:16:33 UTC
On OpenSUSE Tumbleweed I started observing this at the time of my report (i.e. October 18). I don't always install all updates immediately, so it may have appeared a few days or weeks earlier. Obviously I have no idea what version of Kate that is.

Previously there had been similar but different composition-related bugs, but those (besides not being identical in symptoms) were affecting several other applications as well as Kate, and are since fixed:
https://bugzilla.suse.com/show_bug.cgi?id=1187513
Comment 15 Rigo Wenning 2021-12-05 17:03:04 UTC
I have the same here with German umlauts. It wasn't there in early October.  I've seen some input related commits, but can't tell which one could be the culprit. I think this bug is CRITICAL
Comment 16 Christoph Cullmann 2021-12-05 17:07:10 UTC
I would for sure like to help you to fix this, but I can neither reproduce that with 21.08/5.88.0 nor with the current development branch.
(on neither Wayland nor X11)
Comment 17 Rigo Wenning 2021-12-05 18:26:40 UTC
If you're trying to reproduce, do you use a dead-key keyboard? It is NOT simply umlauts, it is the dead keys that do not work in general. A little history shows that the initial direct input from the keyboard was replaced by the ibus framework. I realized this as the character of my US_intl keyboard would not directly appear, but you would see first ' and then type e. They would stand for a ms as 'e and merge to é. In kate does precisely that. First appears " plus a will give ä. First " appears on the screen, then a, then the system merges them rightward to ä, leaving the initial field for " as a space. Then I tried to have " as a character by typing " plus space. Again, this merges rightwards and one gets _" with the additional space. So there MUST be something wrong in kate with the use if ibus and dead key keyboards. If you're not using dead keys, it will be impossible to reproduce IMHO.
Comment 18 Rigo Wenning 2021-12-05 18:40:05 UTC
If I use Meta-p for ö, it works as expected. So it MUST be in the ibus dead key handling and its use in kate. It works normally in other kde apps not using ibus (like kbibtex field filling), but e.g. kile, the latex editor, is equally affected. IMHO there could be an incompatible change either in ibus or in kate-part.
Comment 19 Christoph Cullmann 2021-12-05 19:15:29 UTC
I use here dead keys, e.g. ' + later a ;)
But perhaps the issue is that I don't use ibus, at least I am not aware of using that.
Comment 20 php4fan 2021-12-06 14:33:30 UTC
(In reply to Christoph Cullmann from comment #19)
> I use here dead keys, e.g. ' + later a ;)

By ' you mean ` or ´, right?
Comment 21 Christoph Cullmann 2021-12-06 18:27:48 UTC
Yes, ;=) after typing space that is here converted that way.
Comment 22 Christoph Cullmann 2021-12-27 17:59:26 UTC
Could somebody try the patch from bug 357062?
Thanks!
Comment 23 Christoph Cullmann 2021-12-27 18:06:11 UTC
Ok, I can reproduce on Wayland now.

My issue was mostly that no ibus did run ;=)

If you do e.g. in a terminal

ibus-daemon -drxR

then configure ibus e.g. via the panel applet that for me did popup

then run

export QT_IM_MODULE=ibus
kwrite

you get interesting behavior.

For me ' + e (bugzilla replaces the right char here) will lead to é, but with some "space" before the e...

And other such strange things.

Guess the input method variant of the input is really broken :/
Comment 24 Antonio Rojas 2021-12-27 19:28:57 UTC
*** Bug 447584 has been marked as a duplicate of this bug. ***
Comment 25 Christoph Cullmann 2021-12-27 19:48:20 UTC
Hmm, funny enough, it not always "doesn't work" here.

I have no typed a lot of `e that just combined and some not, in the same session :/

Strange :(
Comment 26 Bug Janitor Service 2021-12-27 20:22:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/237
Comment 27 Christoph Cullmann 2021-12-27 20:24:28 UTC
I would appreciate if people could test:

https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/237

One will loose the properly adjusted cursor for IM text but for me this fixes the issue.

But perhaps I didn't fix all cases or this is not acceptable.
Comment 28 Rigo Wenning 2021-12-27 20:33:23 UTC
Thanks for suggesting a fix
Comment 29 Weng Xuetian 2021-12-28 02:32:38 UTC
Created attachment 144901 [details]
ibus-setup workaround

Just FYI, While we're working on a fix, you may workaround it by unchecking "embed preedit in application" in ibus-setup for now.
Comment 30 Bug Janitor Service 2021-12-28 03:08:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/239
Comment 31 Christoph Cullmann 2021-12-28 18:43:13 UTC
Git commit 3ebdf31474b8d816d5ca7deedd1a23254af2b5c4 by Christoph Cullmann, on behalf of Weng Xuetian.
Committed on 28/12/2021 at 18:33.
Pushed by cullmann into branch 'master'.

Validates the input method attributes received from input method.

A buggy input method may send invalid values to the widget.
E.g. out of range cursor position. Make sure we don't use such value
directly.

M  +7    -5    src/view/kateviewinternal.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/3ebdf31474b8d816d5ca7deedd1a23254af2b5c4
Comment 32 Christoph Cullmann 2022-01-08 16:47:37 UTC
*** Bug 444473 has been marked as a duplicate of this bug. ***
Comment 33 Christoph Cullmann 2022-01-08 17:16:05 UTC
*** Bug 445701 has been marked as a duplicate of this bug. ***
Comment 34 Rigo Wenning 2022-01-09 11:59:12 UTC
(In reply to Weng Xuetian from comment #29)
Yes, that fixed it for me. So thanks a lot!
I started ibus-setup as a normal user and un-ticked the box as described. Additionally, the input is much faster than before for normal ISO-8859-15 charcter set input (I use UTF-8, but my language skills are limited to the European character set). Thanks for finding the workaround. I think I will not enable "embed preedit ..." again, even after a workaround. I think (as we are in a KDE bugtracker), it is also a bug that ibus-setup can not be found in the KDE settings application.