Proper fix for screen freeze

If an X event is received at a very specific point in time, it can trigger
a race condition in Xlib. Said event will be read, but Xlib will
nonetheless be completely unaware of the event.

This cause compton to sometimes block on select() while there are events
ready to be processed. If the event is a damage report, screen freeze
will happen until some other event is received.

The proper fix is to switch to xcb for event handling, thus avoid this
problem entirely.
This commit is contained in:
Yuxuan Shui
2018-09-22 23:44:44 +01:00
parent 43f3744fea
commit 7af815a0aa
4 changed files with 79 additions and 119 deletions

View File

@ -332,14 +332,6 @@ ms_to_tv(int timeout) {
};
}
/**
* Whether an event is DamageNotify.
*/
static inline bool
isdamagenotify(session_t *ps, const XEvent *ev) {
return ps->damage_event + XDamageNotify == ev->type;
}
/**
* Create a XTextProperty of a single string.
*/