Fix backspace/arrow keys in TextEdit on Linux (#5188)

* Closes https://github.com/emilk/egui/issues/5008
* Closes https://github.com/emilk/egui/pull/5182
* Bug introduced in https://github.com/emilk/egui/pull/4912

I suspect this will make IME no longer work on Linux, though I don't
know if it ever worked.
I rather have backspace/arrows working though.

Please help test this (I don't have Linux!)

# Tested on
* [x] Mac
* [ ] Linux Wayland
* [x] Linux X11
This commit is contained in:
Emil Ernerfeldt 2024-09-30 13:23:02 +02:00 committed by GitHub
parent 448e12d6b6
commit 15d3d43aa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 37 additions and 33 deletions

View File

@ -329,6 +329,9 @@ 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.
// //
@ -362,6 +365,7 @@ impl State {
self.ime_event_disable(); self.ime_event_disable();
} }
}; };
}
EventResponse { EventResponse {
repaint: true, repaint: true,