Make enterleave plugin not depend on window level listener

Upcoming #2050 Will break this, so preventively fixing this independently. Tested on both that branch and master, everything works.
What does this comment mean?