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,8 +518,9 @@ 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;
if (tab->num_windows > 0) {
Window *w = tab->windows + tab->active_window; Window *w = tab->windows + tab->active_window;
Screen *screen = w->render_data.screen; Screen *screen = w->render_data.screen;
if (screen) { if (screen) {
@ -527,6 +528,7 @@ get_ime_cursor_position(GLFWwindow *glfw_window, GLFWIMEUpdateEvent *ev) {
ans = true; ans = true;
} }
} }
}
return ans; return ans;
} }