Implement onInActive in window.