Add cursor leave event handling