Update IME position when overlay line is moved on input from child process

This commit is contained in:
Kovid Goyal 2021-11-12 15:07:25 +05:30
parent c8f26dd968
commit 35626d3929
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 4 additions and 2 deletions

View File

@ -747,6 +747,7 @@ screen_draw(Screen *self, uint32_t och, bool from_input_stream) {
if (overlay_text) {
screen_draw_overlay_text(self, PyUnicode_AsUTF8(overlay_text));
Py_DECREF(overlay_text);
update_ime_position_for_window(self->window_id);
}
}

View File

@ -569,7 +569,7 @@ send_pending_click_to_window_id(id_type timer_id UNUSED, void *data) {
}
}
static bool
bool
update_ime_position_for_window(id_type window_id) {
for (size_t o = 0; o < global_state.num_os_windows; o++) {
OSWindow *osw = global_state.os_windows + o;
@ -578,7 +578,7 @@ update_ime_position_for_window(id_type window_id) {
for (size_t w = 0; w < qtab->num_windows; w++) {
Window *window = qtab->windows + w;
if (window->id == window_id) {
if (window->render_data.screen) {
if (window->render_data.screen && osw->is_focused) {
OSWindow *orig = global_state.callback_os_window;
global_state.callback_os_window = osw;
update_ime_position(window, window->render_data.screen);

View File

@ -323,3 +323,4 @@ bool draw_window_title(OSWindow *window, const char *text, color_type fg, color_
uint8_t* draw_single_ascii_char(const char ch, size_t *result_width, size_t *result_height);
bool is_os_window_fullscreen(OSWindow *);
void update_ime_position(Window* w, Screen *screen);
bool update_ime_position_for_window(id_type window_id);