Improved resizing window on OS X (#474)