Implement vsync for the new xrender backend

We use the Present extension for that, since it is the best option we
have.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-01-01 14:23:51 +00:00
parent 6413ccbd71
commit 6d3ea3564b
3 changed files with 100 additions and 40 deletions

View File

@ -2869,7 +2869,15 @@ session_init(session_t *ps_old, int argc, char **argv) {
ext_info = xcb_get_extension_data(ps->c, &xcb_present_id);
if (ext_info && ext_info->present) {
ps->present_exists = true;
auto r =
xcb_present_query_version_reply(ps->c,
xcb_present_query_version(ps->c,
XCB_PRESENT_MAJOR_VERSION,
XCB_PRESENT_MINOR_VERSION),
NULL);
if (r) {
ps->present_exists = true;
}
}
// Query X Sync