Fix issue about not bringing window to foreground when click with border.