could not connect to windows manager

when wmswitch runs, get the error message “could not connect to windows manager” ,then mouse and keyboard can’t be used.