diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index 18f2b58eb65d..99ce62a4049f 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -92,4 +92,10 @@ if(WITH_EXPERIMENTAL_FEATURES) add_definitions(-DWITH_HAIR_NODES) endif() +if(WIN32 OR APPLE) + if(WITH_INPUT_IME) + add_definitions(-DWITH_INPUT_IME) + endif() +endif() + blender_add_lib(bf_editor_object "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 5697c2c973dd..4f06a53a9b2a 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -117,6 +117,11 @@ #include "object_intern.h" /* own include */ +#ifdef WITH_INPUT_IME + #include "wm_window.h" + #include "BLT_lang.h" +#endif + static CLG_LogRef LOG = {"ed.object.edit"}; /* prototypes */ @@ -892,6 +897,14 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op) } FOREACH_SELECTED_OBJECT_END; } + +#ifdef WITH_INPUT_IME + if (obact->type == OB_FONT && BLT_lang_is_ime_supported()) { + wmWindow *win = CTX_wm_window(C); + wm_window_IME_begin(win, 0, 0, 0, 0, true); + } +#endif + } else { ED_object_editmode_exit_ex(bmain, scene, obact, EM_FREEDATA); @@ -904,6 +917,16 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op) } FOREACH_OBJECT_END; } + +#ifdef WITH_INPUT_IME + if (obact->type == OB_FONT) { + wmWindow *win = CTX_wm_window(C); + if (win->ime_data) { + wm_window_IME_end(win); + } + } +#endif + } WM_msg_publish_rna_prop(mbus, &obact->id, obact, Object, mode);