Fix crash when clicking on root window