hints/unicode_input kittens: Do not lose keypresses that are sent very rapidly via an automation tool immediately after the kitten is launched

We now buffer the key events until the kitten tells us it is ready.
Without this the key presses are delivered to the underlying window
as the kitten's overlay window was not being focused until the kitten
set the ready message.

Fixes #7089
This commit is contained in:
Kovid Goyal
2024-12-12 13:11:12 +05:30
parent 9c1324e9d0
commit 9d48fa9126
10 changed files with 131 additions and 38 deletions

View File

@@ -198,6 +198,12 @@ typedef struct {
monotonic_t last_drag_scroll_at;
uint32_t last_special_key_pressed;
WindowBarData title_bar_data, url_target_bar_data;
id_type redirect_keys_to_overlay;
struct {
bool enabled;
void *key_data;
size_t count, capacity;
} buffered_keys;
struct {
PendingClick *clicks;
size_t num, capacity;
@@ -417,3 +423,4 @@ void change_live_resize_state(OSWindow*, bool);
bool render_os_window(OSWindow *w, monotonic_t now, bool ignore_render_frames, bool scan_for_animated_images);
void update_mouse_pointer_shape(void);
void adjust_window_size_for_csd(OSWindow *w, int width, int height, int *adjusted_width, int *adjusted_height);
void dispatch_buffered_keys(Window *w);