Merge pull request #98887 from bruvzg/ime_altgr

Fix IME deactivation events not send on focus loss. Do not unset AltGr modifiers in non-IME input.
This commit is contained in:
Thaddeus Crews 2024-11-07 12:36:22 -06:00
commit f74b7e2009
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
3 changed files with 6 additions and 2 deletions

View File

@ -5438,7 +5438,7 @@ void DisplayServerWindows::_process_key_events() {
k->set_physical_keycode(physical_keycode);
k->set_key_label(key_label);
k->set_unicode(fix_unicode(unicode));
if (k->get_unicode() && ke.altgr) {
if (k->get_unicode() && ke.altgr && windows[ke.window_id].ime_active) {
k->set_alt_pressed(false);
k->set_ctrl_pressed(false);
}
@ -5514,7 +5514,7 @@ void DisplayServerWindows::_process_key_events() {
}
k->set_unicode(fix_unicode(unicode));
}
if (k->get_unicode() && ke.altgr) {
if (k->get_unicode() && ke.altgr && windows[ke.window_id].ime_active) {
k->set_alt_pressed(false);
k->set_ctrl_pressed(false);
}

View File

@ -128,6 +128,7 @@ bool LineEdit::has_ime_text() const {
void LineEdit::cancel_ime() {
if (!has_ime_text()) {
_close_ime_window();
return;
}
ime_text = String();
@ -140,6 +141,7 @@ void LineEdit::cancel_ime() {
void LineEdit::apply_ime() {
if (!has_ime_text()) {
_close_ime_window();
return;
}

View File

@ -3169,6 +3169,7 @@ bool TextEdit::has_ime_text() const {
void TextEdit::cancel_ime() {
if (!has_ime_text()) {
_close_ime_window();
return;
}
ime_text = String();
@ -3181,6 +3182,7 @@ void TextEdit::cancel_ime() {
void TextEdit::apply_ime() {
if (!has_ime_text()) {
_close_ime_window();
return;
}