Bug 482864 - Emoji typed via input method is not displayed in Kate after upgrade to KDE6.
Summary: Emoji typed via input method is not displayed in Kate after upgrade to KDE6.
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.02.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-08 12:20 UTC by BryanLiang
Modified: 2024-03-21 16:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BryanLiang 2024-03-08 12:20:57 UTC
SUMMARY
***
Emoji typed via input method is not displayed in Kate after upgrade to KDE6. Some emojis copied from other applications like firefox are displayed in no color.
***


STEPS TO REPRODUCE
1.  Open the Kate
2.  Try to type the emoji via input method like Fcitx5

OBSERVED RESULT
Emoji displays normally.

EXPECTED RESULT
Emoji does not show up.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2


ADDITIONAL INFORMATION

Here is the screen record of the situation.
https://vimeo.com/921076013?share=copy
Comment 1 BryanLiang 2024-03-09 12:51:39 UTC
I did some investigations and found out that the no color emoji is caused by the order in fontconfig. But it is still unable to type emoji in Kate.
Comment 2 BryanLiang 2024-03-10 09:08:50 UTC
Here's all the findings of the bug I encountered

1. The emoji typed via input method does not show up in Kate. For example, you use Fcitx5, type 'haha' and press 1, there will be 😃 displayed in Kate under normal circumstances. But the current situation is that 😃 does not show up.

2. Another problem that emoji copied from other applications displays in no color is my fault. Once I raised the priority of Twemoji in the fontconfig, the colors come back.
Comment 3 fanzhuyifan 2024-03-21 04:16:47 UTC
Can reproduce inputting emojis by fcitx5 not working.

The color being black and white is a local config issue.
Comment 4 fanzhuyifan 2024-03-21 04:44:25 UTC
The problem is that KateViewInternal::isAcceptableInput returns false for emojis

https://invent.kde.org/frameworks/ktexteditor/-/blob/master/src/view/kateviewinternal.cpp#L3348
Comment 5 Bug Janitor Service 2024-03-21 05:00:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/674
Comment 6 fanzhuyifan 2024-03-21 16:46:24 UTC
Git commit f9f7f640b05d96b8dcf779ea72d5c3e2315da0df by Yifan Zhu.
Committed on 21/03/2024 at 04:58.
Pushed by cullmann into branch 'master'.

kateviewinternal: accept surrogate category character

This is added to QInputControl::isAcceptableInput in
https://github.com/qt/qtbase/commit/e688b99995b8c624dbcea296c99fb89262d29e15.

M  +9    -2    src/view/kateviewinternal.cpp

https://invent.kde.org/frameworks/ktexteditor/-/commit/f9f7f640b05d96b8dcf779ea72d5c3e2315da0df