setup 闭包借用 shutdown_flag 但要求 'static, on_window_event 又要 move 它。builder 链前各自 clone 出 setup_flag/event_flag, 两处闭包分别 move。