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.
This commit is contained in:
Severin 2014-12-14 18:46:51 +01:00
parent c1d3532d2c
commit ae6f62c4e2
2 changed files with 7 additions and 2 deletions

View File

@ -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
}

View File

@ -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);
}