tomooda / PharoIM

InputMethod support for Pharo on headless VMs
MIT License
6 stars 0 forks source link

No SDL_TextEditingEvent on linux #11

Open tomooda opened 2 years ago

tomooda commented 2 years ago

Pharo does not receive SDL_TextEditingEvent on Ubuntu Linux. Translation buffer opens at the bottom of the screen instead of inline editing. After fixating the translation buffer, SDL_TextInputEvent is received by RubAbstractTextArea.

Pharo version: 9.0 SDL2: 2.0.7 IM: ibus - mozc

Maybe some initialization of SDL2 to use ibus IM is required. Tried SDL_IM_MODULE=ibus in /etc/environment, but no success.

tomooda commented 2 years ago

need to confirm if the libsdl2 used in the pharo VM is configured with --enable-ime option and SDL_USE_IME is defined in the compilation.

guillep commented 2 years ago

Take a look at: https://github.com/pharo-project/opensmalltalk-vm/blob/pharo-9/cmake/importSDL2.cmake#L56

There are three possibilities:

tomooda commented 2 years ago

I tried on Ubuntu 20.04.3 LTS and its /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.10.0 seems to be working at least to handle the IME events and inline IME (see the attached screendump). We need to replace the libSDL2-2.0.so.0 if we really deserve the SDL_TextEditingEvent.

mozc-ibus-IM-on-Ubuntu-system-SDL2

In a long run, it would be the best if the libSDL2 on the file server is compiled with ime support. I suspect the build environment might have missed ime/ibus/fcitx related headers. The configuration options --enable-ime, --enable-ibus and --enable-fcitx are all set to yes by default.

For now, I think we can offer the choices open to the user; either patch the SDL2 class to use the system libSDL2.so, or keep using Pharo without IM support.