summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-01-10 16:38:48 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-01-10 16:38:48 +0100
commit70fff72e2dc3387652efef1e56edc91661e292d3 (patch)
treeca1573fd612a97b10067c51496cd32ee1c11f80b /src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
parent7bb8bdb1fa2768dc19cf428e0b013ab66191b9e9 (diff)
Wayland platform: fix handling of key repeats
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 4a7ace768..47cd8da2e 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -559,6 +559,9 @@ static int process_wld_key(struct xkb_state *xkb_state, uint32_t key,
}
+static uint32_t last_keydown_serial = 0; // serial of last keydown event
+
+
static void wl_keyboard_enter(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, struct wl_surface *surface, struct wl_array *keys) {
struct Fl_Wayland_Screen_Driver::seat *seat =
@@ -582,6 +585,7 @@ static void wl_keyboard_enter(void *data, struct wl_keyboard *wl_keyboard,
//fprintf(stderr, "\n");
seat->keyboard_surface = surface;
seat->keyboard_enter_serial = serial;
+ last_keydown_serial = 0;
Fl_Window *win = Fl_Wayland_Window_Driver::surface_to_window(surface);
if (win) {
Fl::handle(FL_FOCUS, win);
@@ -594,7 +598,6 @@ struct key_repeat_data_t {
uint32_t serial;
Fl_Window *window;
};
-static uint32_t last_keydown_serial = 0; // serial of last keydown event
#define KEY_REPEAT_DELAY 0.5 // sec
#define KEY_REPEAT_INTERVAL 0.05 // sec