Re-enable IME support on Linux (#5198)
Reverts #5188 and adds a different fix to restore IME on Linux without breaking the backspace and arrow keys. * Closes https://github.com/emilk/egui/issues/5544 * Closes https://github.com/emilk/egui/pull/5198 * [x] I have followed the instructions in the PR template
This commit is contained in:
parent
e32ca218e8
commit
3ffe1ed774
|
|
@ -333,9 +333,6 @@ impl State {
|
|||
}
|
||||
|
||||
WindowEvent::Ime(ime) => {
|
||||
if cfg!(target_os = "linux") {
|
||||
// We ignore IME events on linux, because of https://github.com/emilk/egui/issues/5008
|
||||
} else {
|
||||
// on Mac even Cmd-C is pressed during ime, a `c` is pushed to Preedit.
|
||||
// So no need to check is_mac_cmd.
|
||||
//
|
||||
|
|
@ -351,8 +348,14 @@ impl State {
|
|||
// between Commits.
|
||||
match ime {
|
||||
winit::event::Ime::Enabled => {
|
||||
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();
|
||||
self.egui_input
|
||||
|
|
@ -369,7 +372,6 @@ impl State {
|
|||
self.ime_event_disable();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
EventResponse {
|
||||
repaint: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue