Fixes #1296 Apparently, macOS reports NaN DPI values in this scenario. I dont know enough about cocoa internals to understand why, or what is actually supposed to happen in this scenario, but at least we should not crash.
resize_window