Ensure refresh rate doesn't go above screen refresh rate

This should solve the issue on macs where obscuring the
window fully lead to constant rerenders and 100% cpu.