Write queue after connect windows

style: brace in the same line as function definition.