Accessibility is so very fragile. So many little details have to be right. And no matter how much I want to bottle all of that up in a reusable library, there's only so much that can be encapsulated.
Case in point: Blocking the UI thread is asking for trouble. It's especially problematic, at least on Windows, to create a window, show it, then block the UI thread while compiling shaders. The screen reader times out and then doesn't handle focus events correctly.