If it works, this is cleaner and more predictable. I don't think there's any way the settings will be saved without first passing through on.quit
I'm still a little uncertain, so I'm leaving a tripwire; driver.love will again complain loudly rather than try to gracefully recover if the window size ever gets too large.
VUJJNWJDHQFAQO4QGV7YOXG3K7M66P7SIYNA22R36LIBDKFMKPIQC if settings.width > 4096 or settings.height > 4096 then-- if you request too large a window SDL will irrecoverably crashsettings.width, settings.height = 800, 600 -- reinitializeend
assert(settings.width < 4096 and settings.height < 4096, "You've hit a bug Kartik has been chasing for a while. Please let me know by emailing ak@akkartik.com, I'd really appreciate it.")
on.quit = function()if Saved_screen then-- snapshot_canvas in progress; restore real window dimensions before saving them to configApp.screen.width,App.screen.height = Saved_screen.w, Saved_screen.hendend