Review the use of XFlush and xcb_flush

Replace most of XFlush with xcb_flush.

Also, in a lot of places, XFlush is used as if it is XSync. Replace
those cases by using xcb's _checked version of functions and
xcb_request_check.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-02-07 00:41:24 +00:00
parent 856ad4b230
commit 22bc79369e
3 changed files with 41 additions and 23 deletions

View File

@ -650,11 +650,14 @@ void win_mark_client(session_t *ps, win *w, xcb_window_t client) {
if (w->a.map_state != XCB_MAP_STATE_VIEWABLE)
return;
xcb_change_window_attributes(ps->c, client, XCB_CW_EVENT_MASK,
(const uint32_t[]) { determine_evmask(ps, client, WIN_EVMODE_CLIENT) });
// Make sure the XSelectInput() requests are sent
XFlush(ps->dpy);
auto e = xcb_request_check(
ps->c, xcb_change_window_attributes(
ps->c, client, XCB_CW_EVENT_MASK,
(const uint32_t[]){determine_evmask(ps, client, WIN_EVMODE_CLIENT)}));
if (e) {
log_error("Failed to change event mask of window %#010x", client);
free(e);
}
win_upd_wintype(ps, w);