improve focus, fix a bug that affected floating windows