[Bf-blender-cvs] [ae6f62c] master: IME fix: Quit two assert failures

Severin noreply at git.blender.org
Sun Dec 14 18:51:57 CET 2014


Commit: ae6f62c4e2090ea8987bad9af67fad33cbe55966
Author: Severin
Date:   Sun Dec 14 18:46:51 2014 +0100
Branches: master
https://developer.blender.org/rBae6f62c4e2090ea8987bad9af67fad33cbe55966

IME fix: Quit two assert failures

We could now also remove the win->ime_data assert in wm_window_IME_end,
but think it's better to leave it for further development.

===================================================================

M	source/blender/editors/interface/interface_handlers.c
M	source/blender/windowmanager/intern/wm_window.c

===================================================================

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 31a6635..413f878 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2436,6 +2436,8 @@ static void ui_textedit_ime_begin(wmWindow *win, uiBut *UNUSED(but))
 	/* XXX Is this really needed? */
 	int x, y;
 
+	BLI_assert(win->ime_data == NULL);
+
 	/* enable IME and position to cursor, it's a trick */
 	x = win->eventstate->x;
 	/* flip y and move down a bit, prevent the IME panel cover the edit button */
@@ -2573,7 +2575,9 @@ static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data)
 	WM_cursor_modal_restore(win);
 
 #ifdef WITH_INPUT_IME
-	ui_textedit_ime_end(win, but);
+	if (win->ime_data) {
+		ui_textedit_ime_end(win, but);
+	}
 #endif
 }
 
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 0b33dbb..52fcdd7 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1526,9 +1526,10 @@ bool WM_window_is_fullscreen(wmWindow *win)
 
 
 #ifdef WITH_INPUT_IME
+/* note: keep in mind wm_window_IME_begin is also used to reposition the IME window */
 void wm_window_IME_begin(wmWindow *win, int x, int y, int w, int h, bool complete)
 {
-	BLI_assert(win && (win->ime_data == NULL));
+	BLI_assert(win);
 
 	GHOST_BeginIME(win->ghostwin, x, win->sizey - y, w, h, complete);
 }




More information about the Bf-blender-cvs mailing list