Make closing window end call

Wait for core merge