Added the listener functionality for the windowing mode