fix some focus and window stacking issue