fix a crash when the focused window is the root window