osx: perform window management funcs in main thread