Emits an IME lost focus event when the window lost focus or closed

This commit is contained in:
pagedown
2022-01-27 10:13:57 +08:00
parent 4d920b182f
commit a987fb81a0
6 changed files with 21 additions and 7 deletions

View File

@@ -79,6 +79,12 @@ active_window(void) {
return NULL;
}
void
update_ime_focus(OSWindow *osw, bool focused) {
GLFWIMEUpdateEvent ev = { .focused = focused, .type = GLFW_IME_UPDATE_FOCUS };
glfwUpdateIMEState(osw->handle, &ev);
}
void
update_ime_position(Window* w, Screen *screen) {
unsigned int cell_width = global_state.callback_os_window->fonts_data->cell_width, cell_height = global_state.callback_os_window->fonts_data->cell_height;