mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-31 06:18:17 +00:00
Fix IME popup position after text_input re-enters on Wayland
When a kitty window regains text-input focus (e.g. switching back to a workspace in sway, unminimizing, or unlocking the screen), the zwp_text_input_v3::enter event is fired. However, text_input_enter() only called enable + set_content_type without restoring the cursor rectangle. If the compositor does not re-send wl_keyboard.enter at the same time, kitty never updates the IME position, causing the popup to appear at the top-left corner. Restore the last known cursor rectangle in text_input_enter() so the IME popup immediately appears at the correct position.
This commit is contained in:
parent
efc31d9de8
commit
00029d0a6f
1 changed files with 9 additions and 0 deletions
9
glfw/wl_text_input.c
vendored
9
glfw/wl_text_input.c
vendored
|
|
@ -35,6 +35,15 @@ text_input_enter(void *data UNUSED, struct zwp_text_input_v3 *txt_input, struct
|
|||
ime_focused = true;
|
||||
zwp_text_input_v3_enable(txt_input);
|
||||
zwp_text_input_v3_set_content_type(txt_input, ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE, ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TERMINAL);
|
||||
if (last_cursor_width > 0) {
|
||||
zwp_text_input_v3_set_cursor_rectangle(
|
||||
txt_input,
|
||||
last_cursor_left,
|
||||
last_cursor_top,
|
||||
last_cursor_width,
|
||||
last_cursor_height
|
||||
);
|
||||
}
|
||||
commit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue