Fix alt-tab + move sys_inactivesleep so it works on all platforms