Merge "Run layout when exiting window" into pi-dev