mirror of
https://github.com/yshui/picom.git
synced 2024-11-11 13:51:02 -05:00
Handle xcb_wait_for_special_events failure
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
29ceea8412
commit
2699367b46
1 changed files with 7 additions and 0 deletions
|
@ -548,6 +548,13 @@ static void present(void *backend_data, session_t *ps) {
|
|||
// TODO don't block wait for present completion
|
||||
xcb_present_generic_event_t *pev =
|
||||
(void *)xcb_wait_for_special_event(ps->c, xd->present_event);
|
||||
if (!pev) {
|
||||
// We don't know what happened, maybe X died
|
||||
// But reset buffer age, so in case we do recover, we will
|
||||
// render correctly.
|
||||
xd->buffer_age[0] = xd->buffer_age[1] = -1;
|
||||
return;
|
||||
}
|
||||
assert(pev->evtype == XCB_PRESENT_COMPLETE_NOTIFY);
|
||||
xcb_present_complete_notify_event_t *pcev = (void *)pev;
|
||||
// log_trace("Present complete: %d %ld", pcev->mode, pcev->msc);
|
||||
|
|
Loading…
Reference in a new issue