LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
13.09k stars 521 forks source link

Add IME support in chrome and webviews in Wayland #194

Open nonetrix opened 1 month ago

nonetrix commented 1 month ago

Japanese, Korean, and Chinese need IME (Input Method Editor) to input their characters, as it is currently it seems that IMEs are not supported in the browser chrome or inside of webviews. The chrome should be easy as it is QT, honestly confused why it isn't already working the browser itself might be harder

ADKaster commented 1 month ago

Do you have an example of a Qt app that can throw up an input method editor that allows inputting CJK unicode characters? Or a reference to which Qt6 class this comes from? Note that we also have an AppKit chrome for use on macOS, so we'll need a solution that works there as well.

But also, our KeyboardInput routines do not recognize anything outside of the standard en_US keyboard layout, as seen here:

https://github.com/LadybirdBrowser/ladybird/blob/bf3c11229f2f2fe3423004f6fff0ec6867f7f28a/Ladybird/Qt/WebContentView.cpp#L197-L314

So I doubt supporting this is quite as simple as you're thinking. There are extra key codes in the Qt::Key enum that we don't know what to do with in the Web Engine itself.

honestly confused why it isn't already working the browser itself might be harder

This is pretty straightforward to explain. There aren't any current regular contributors who speak any East Asian languages, or use computers in those locales. If you want to help us figure out how to un-westernize our input methods, please hop on discord and come chat with us :).

nonetrix commented 1 month ago

I honestly don't have the programming experience to really help I think yet, I've been lately trying to understand C++ more though so maybe some day mostly trying to understand pointers which I've gotten fairly far. I think another reason why it might not work in the browser chrome is that it seems to be using XWayland, I think that should work in theory but also Hyprland (my compositor of choice) has rewritten their XWayland implementation from wlroots to their own among the missing features in drag and drop maybe this is another? I will have to test on another compositor and XOrg itself later I guess. But every QT app has supported IME with no issues, only issues I've had with IME with general desktop use are games I guess but somewhat to be expected

Not sure why it doesn't run on Wayland if it's using QT6 also, is it similar situation with Krita where it relies on XOrg in a weird way where just enabling it would still depend on XOrg thus breaking the whole universe and space time with it? I assumed it was old QT version at fault