Skip to content
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

Re-enable IME support on Linux #5198

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

YgorSouza
Copy link
Contributor

@YgorSouza YgorSouza commented Sep 30, 2024

Reverts #5188 and adds a different fix to restore IME on Linux without breaking the backspace and arrow keys.

  • I have followed the instructions in the PR template

It means different things on X11 and Wayland, and causes us to assume
IME is active when it isn't, causing the backspace and arrow keys to be
disabled.
Copy link

Preview available at https://egui-pr-preview.github.io/pr/5198-fix-linux-ime
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@YgorSouza
Copy link
Contributor Author

@rustbasic @crumblingstatue can you test this?

I've tested with Fedora 40/Gnome 46 with both the regular (Wayland) session and the XOrg session, with the compose key, the Unicode input (Ctrl+Shift+U) and the Chinese (Intelligent Pinyin) input source. Everything seems to work, and the backspace and arrow keys work on both as well.

@crumblingstatue
Copy link
Contributor

I can't test IME, because fcitx (& pals) somehow break my X11 setup (don't ask me how), but I can confirm that backspace and arrow keys work.

@rustbasic
Copy link
Contributor

Dear emilk & Dear YgorSouza

My opinion is,

@YgorSouza
Copy link
Contributor Author

I'm not sure if it will work well on some Linux + Chinese

Is there anyone who can test this? I mean, it seems fine to me, but I'm not Chinese so I don't know.

image

#5182 looks like it would require a major release? It's adding fields to structs, so I guess that's a breaking change. But if we can get the IME to work correctly on all platforms, maybe it won't be needed? And egui-winit already has an allow_ime field, so we could block IME events at this level, if needed, without involving the TextEdit or any other widgets.

let allow_ime = ime.is_some();
if self.allow_ime != allow_ime {
self.allow_ime = allow_ime;
crate::profile_scope!("set_ime_allowed");
window.set_ime_allowed(allow_ime);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants