Skip to content

Commit

Permalink
Ignore Ime::Enabled event on Linux
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
YgorSouza committed Sep 30, 2024
1 parent a72bdd7 commit a293206
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,13 @@ impl State {
// between Commits.
match ime {
winit::event::Ime::Enabled => {
self.ime_event_enable();
if cfg!(target_os = "linux") {
// This event means different things in X11 and Wayland, but we can just
// ignore it and enable IME on the preedit event.
// See <https://github.com/rust-windowing/winit/issues/2498>
} else {
self.ime_event_enable();
}
}
winit::event::Ime::Preedit(text, Some(_cursor)) => {
self.ime_event_enable();
Expand Down

0 comments on commit a293206

Please sign in to comment.