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) => {
|
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.
|
// on Mac even Cmd-C is pressed during ime, a `c` is pushed to Preedit.
|
||||||
// So no need to check is_mac_cmd.
|
// So no need to check is_mac_cmd.
|
||||||
//
|
//
|
||||||
|
|
@ -351,8 +348,14 @@ impl State {
|
||||||
// between Commits.
|
// between Commits.
|
||||||
match ime {
|
match ime {
|
||||||
winit::event::Ime::Enabled => {
|
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();
|
self.ime_event_enable();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
winit::event::Ime::Preedit(text, Some(_cursor)) => {
|
winit::event::Ime::Preedit(text, Some(_cursor)) => {
|
||||||
self.ime_event_enable();
|
self.ime_event_enable();
|
||||||
self.egui_input
|
self.egui_input
|
||||||
|
|
@ -369,7 +372,6 @@ impl State {
|
||||||
self.ime_event_disable();
|
self.ime_event_disable();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
EventResponse {
|
EventResponse {
|
||||||
repaint: true,
|
repaint: true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue