Check if window is exist in working thread

Signed-off-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw>