add pthread_mutex, get_window_geom()