added multiple window mode with context switching
-bug: sometimes unnormal sub-window closing