Add support for window resizing
Fix bug from earlier commit
syncing all local changes