Fix error under KDE+Wayland where keystrokes tend to be repeated

see also: fltk-rs/fltk-rs#1539
This commit is contained in:
ManoloFLTK 2024-04-25 11:52:06 +02:00
parent 38c9ebc29d
commit 6d21285e0f

View File

@ -770,6 +770,9 @@ static void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard,
} }
} else { } else {
remove_int_vector(key_vector, for_key_vector); remove_int_vector(key_vector, for_key_vector);
// Under KDE, the time value received doesn't change at each keystroke as it should,
// so we remove any key repeat timer at each FL_KEYUP event.
Fl::remove_timeout((Fl_Timeout_Handler)key_repeat_timer_cb);
} }
Fl::e_text = buf; Fl::e_text = buf;
Fl::e_length = (int)strlen(buf); Fl::e_length = (int)strlen(buf);