Xorg doesn't like sending damage events for some reason

Yuxuan Shui yshuiv7 at gmail.com
Sun Sep 9 20:23:35 UTC 2018


Hi,

Recently, some users of compton[1] has noticed a bug, where the contents of
windows will freeze while there are indeed updates happening (e.g. when
viewing a video, the video will freeze while the sound is still playing).
For more background, please see[2].

So I tried to look into this problem. Internally, compton uses the damage
event to track if the screen needs updating. Essentially, when a new window
is created, XDamageCreate is called to get damage events
(DamageReportNonEmpty), then compton sits in a select() loop, and process
damage events accordingly. Every time a damage notify is received,
DamageSubtract is called to clear the damage, and the screen is repainted.

The problem is, some time, the select() will just not return, even when
contents of some windows are clearly been updated. Usually if some other
event happens when this is going on, select() will return, and XNextEvent()
will return the other event, and the damage notify event. So looks like the
damage event is not lost, and is probably just stuck in some queue
somewhere.

Also, this problem seems to be heavily timing dependent. I haven't been
able to reproduce this problem when running compton under strace.

Right now I'm working around this problem by using
DamageReportRawRectangles, which seems to work.

If you have any idea where the problem could be, please help.

Thanks.

[1]: https://github.com/chjj/compton
[2]: https://github.com/chjj/compton/issues/494

-- 

Regards
Yuxuan Shui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180909/5ad4c01a/attachment.html>


More information about the xorg-devel mailing list