core: only grab X server when there indeed is new windows

Shouldn't grab X server for nothing.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-04-25 04:14:32 +01:00
parent 46b8eb8d4d
commit cfbd1819ed
3 changed files with 30 additions and 20 deletions

View File

@ -958,6 +958,7 @@ static struct win *add_win(session_t *ps, xcb_window_t id, struct list_node *pre
new_w->destroyed = false;
HASH_ADD_INT(ps->windows, id, new_w);
ps->has_new_window = true;
return new_w;
}