Fix InputMethodContext to work well in multi-window env