Improved window resizing adapting