Wayland: stop key repeats when focus leaves a window

This commit is contained in:
ManoloFLTK 2024-06-23 08:05:53 +02:00
parent 115ae94de0
commit 7a35e256bc

View File

@ -844,6 +844,7 @@ static void wl_keyboard_leave(void *data, struct wl_keyboard *wl_keyboard,
struct Fl_Wayland_Screen_Driver::seat *seat = (struct Fl_Wayland_Screen_Driver::seat*)data; struct Fl_Wayland_Screen_Driver::seat *seat = (struct Fl_Wayland_Screen_Driver::seat*)data;
//fprintf(stderr, "keyboard leave fl_win=%p\n", Fl_Wayland_Window_Driver::surface_to_window(surface)); //fprintf(stderr, "keyboard leave fl_win=%p\n", Fl_Wayland_Window_Driver::surface_to_window(surface));
seat->keyboard_surface = NULL; seat->keyboard_surface = NULL;
last_keydown_serial = 0;
Fl_Window *win = Fl_Wayland_Window_Driver::surface_to_window(surface); Fl_Window *win = Fl_Wayland_Window_Driver::surface_to_window(surface);
if (!win && Fl::focus()) win = Fl::focus()->top_window(); if (!win && Fl::focus()) win = Fl::focus()->top_window();
if (win) Fl::handle(FL_UNFOCUS, win); if (win) Fl::handle(FL_UNFOCUS, win);