enable/disable mouse when leaving the window