App Window mainloop moved to a separate thread