tests: Exit test when main window is closed
render: Optimize the no-borders case to exit early
shadows: Respect scaled factors for cached surface