fix a keyboard focus bug.

Bug fix: keyboard will loose focus when recovering from minimized state.