New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In WhatsApp and Telegram (used in Firefox) in the middle of the message, when a new word is being started, the first character disappears #473
Comments
Happens even more often on Telegram. |
Video using WhatsApp: |
It appears that some randomness commands the occurrence of the issue, Mike: Sometimes, it occurs very often while writing a same message. |
É
problem is fixed, Mike, from time to time, again on Firefox Web WhatsApp, in the middle of the message, when a new word is being started, the first character disappears.
I think I have a fix/workaround. My current fix/workaround is already an improvement, the first character of a new word now never seems to vanish in WhatsApp and Telegram when using in Firefox. But, when the input becomes empty after a commit and a prediction should appear because the option
is used (The problem reported here seems to occur only when that option is used), then sometimes that prediction does not appear. That is already much better then when first characters of new words disappear, with my current fix/workaround, one sometimes does not get a prediction when there should be one, that is not nice but not as bad as a typed character disappearing. |
Video showing the remaining problem in Telegram. About every second time, the prediction which should appear when the input is empty does not appear. It is not exactly every second time, just on the average about every second time: Peek.2023-12-12.17-54.mp4 |
Yes, I agree with you that the workaround, although not the best solution, is much better than the current status quo. Maybe, another workaround is to pass that option from 0 to 1. |
Yet, another workaround is to use Chrome instead of Firefox! ;-) |
But we want to be able to continue to use 0 for that option. |
Now I have improved my workaround to also show the predictions on empty input always when they should be shown. https://copr.fedorainfracloud.org/coprs/mfabian/ibus-typing-booster/builds/ |
Seems to work with ibus-typing-booster-2.24.6: Peek.2023-12-12.21-33.mp4 |
Thanks, Mike. It appears that it is working properly, but, maybe, we should wait for longer to make sure the issues does not reappear. |
There is an innocuous side-effect: The suggested word is repeated in Please, see the attached video. Peek.2023-12-13.11-38.mp4 |
Yes, Mike. That is innocuous though. |
Before the fix/workaround for this issue here I did the following when the word
But in this procedure, the preedit is update twice during the same key event. That causes sometimes disappearing characters in WhatsApp and Telegram. If the preedit is updated twice in quick succession, WhatsApp and Telegram trigger a callback to Now I do only this:
I.e. I omitted the first update of the preedit to empty directly after the commit. So now the word
That takes some time and during that time the underlined preedit containing
And the old preedit containing Before I had an update to an empty preedit immediately after the commit, in the next line in the source code where the commit really happend. Therefore,
But now it is
So with the new code, it takes too much time until everything is done and the preedit is updated to the final result at last. I cannot make that work inbetween faster, so I wonder what I could do here. Doing fewer updates of the preedit seems generally like a good idea. Not only because of WhatsApp and Telegram in Firefox, similar problems sometimes occur when using Gnome Wayland because of problems in Mutter. When doing ibus actions like
then Mutter sometimes changes the order of the events or looses some of the events. I.e. when committing Overall I got the impression that it is good to do as few of these ibus actions as possible during the processing of one key event.
I don’t like that old preedit lingering around so long. But I have no idea what I can do here. Updating the preedit again directly after the commit brings back the problem in WhatsApp and Telegram and maybe also causes problems in Mutter (Gnome Wayland) and maybe in other places as well. Doing many ibus actions during processing one key event should work, but what can I do when there are applications where it doesn't work? Doing as few such ibus actions as possible during one key event reduces the likelyhood that something can go wrong. If there is only one action, it cannot be overwritten by another action or change order with another action. So fewer actions makes it more reliable, but fewer update preedits may cause a wrong preedit linger for longer causing this very irritating flicker. |
That is really an intricate problem, Mike! Personally, I do not mind the duplicated |
Even with But predicting the next word when using |
Yes, I think if I only have the choice between loosing characters or reversing order in some applications and some visual distraction by a preedit which stays too long, I choose the visual distraction. Better some visual distraction which does not harm other than hurt the eyes than a clearly wrong result. If I could make the prediction of the next word faster, this would become less visible. But looking at the code to predict the next word, I see no obvious way to make it faster. |
Resolves: #473 - Do not clear input if there is no input - Avoid clearing the input if a preedit has just been reopened - Better debug output This previous commit commit af92780 Author: Mike FABIAN <mfabian@redhat.com> Date: Tue Dec 12 17:39:03 2023 +0100 Fix disappearing first characters or words in the web clients of WhatsApp and Telegram used in Firefox Resolves: #473 When super().update_preedit_text_with_mode() is called more than once during the processing of one key event, this may trigger calls to the do_reset() callback when the web clients of WhatsApp or Telegrams are used in Firefox. This change avoids multiple calls to super().update_preedit_text_with_mode() one call per key event should be enough. already avoided many do_reset() calls. This commit here avoids some harm caused by the remaining calls to do_reset().
That occurs with not accented first characters, and I have not, until now, devised a systematic way of reproducing the issue.
The issue does not occur when using Chrome.
Originally posted by @psads-git in #471 (comment)
The text was updated successfully, but these errors were encountered: