From 6413ccbd715b31f6ab4b890019e7db3a7603dc48 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Tue, 1 Jan 2019 14:09:55 +0000 Subject: [PATCH] Improve XSync extension detection Signed-off-by: Yuxuan Shui --- src/compton.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/compton.c b/src/compton.c index 5edc2c7..7e0746a 100644 --- a/src/compton.c +++ b/src/compton.c @@ -2878,8 +2878,13 @@ session_init(session_t *ps_old, int argc, char **argv) { ps->xsync_error = ext_info->first_error; ps->xsync_event = ext_info->first_event; // Need X Sync 3.1 for fences - auto r = xcb_sync_initialize_reply(ps->c, xcb_sync_initialize(ps->c, 3, 1), NULL); - if (r) { + auto r = xcb_sync_initialize_reply(ps->c, + xcb_sync_initialize(ps->c, + XCB_SYNC_MAJOR_VERSION, + XCB_SYNC_MINOR_VERSION), + NULL); + if (r && (r->major_version > 3 || + (r->major_version == 3 && r->minor_version >= 1))) { ps->xsync_exists = true; free(r); }