Handle mouse cursor hiding more elegantly.