Fixed infinite recursion when setting window style on OS X 10.6 or newer