This commit is contained in:
Kovid Goyal 2023-02-23 22:19:45 +05:30
parent e41897f93f
commit c5149dec24
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -518,13 +518,15 @@ static bool
get_ime_cursor_position(GLFWwindow *glfw_window, GLFWIMEUpdateEvent *ev) { get_ime_cursor_position(GLFWwindow *glfw_window, GLFWIMEUpdateEvent *ev) {
bool ans = false; bool ans = false;
OSWindow *osw = os_window_for_glfw_window(glfw_window); OSWindow *osw = os_window_for_glfw_window(glfw_window);
if (osw && osw->is_focused && is_window_ready_for_callbacks()) { if (osw && osw->is_focused && osw->num_tabs > 0) {
Tab *tab = osw->tabs + osw->active_tab; Tab *tab = osw->tabs + osw->active_tab;
Window *w = tab->windows + tab->active_window; if (tab->num_windows > 0) {
Screen *screen = w->render_data.screen; Window *w = tab->windows + tab->active_window;
if (screen) { Screen *screen = w->render_data.screen;
prepare_ime_position_update_event(osw, w, screen, ev); if (screen) {
ans = true; prepare_ime_position_update_event(osw, w, screen, ev);
ans = true;
}
} }
} }
return ans; return ans;