From 6d21285e0f7462cc1d98c92242cd4a917b765b5a Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 25 Apr 2024 11:52:06 +0200 Subject: [PATCH] Fix error under KDE+Wayland where keystrokes tend to be repeated see also: fltk-rs/fltk-rs#1539 --- src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 115f9765c..c8bbcefb0 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -770,6 +770,9 @@ static void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard, } } else { 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_length = (int)strlen(buf);