Modified close event of window widget