merge error functions into one
lazy init detached window (prevent taking default graphics context)