Skip to content
Commit b3214db0 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

x11: Make damage region fetching code more robust to errors

With DamageReportNonEmpty damage report level, the x server will
send kwin a DamageNotify when the damage region changes from empty to
not empty.

The damage region will be made empty when SurfaceItemX11 calls
xcb_damage_subtract().

It appears like xcb_generate_id() can return us an already associated
XID, which eventually results in xcb_damage_subtract() failing and
breaking state tracking in SurfaceItemX11. KWin will no longer receive
DamageNotify events and some windows will freeze.

In order to make getting BadIdChoice less catastrophic, this change
makes the SurfaceItemX11 reset m_isDamaged after successfully fetching
the damage region. If xcb_generate_id() returns us a bad id, kwin will
try to fetch the damage again in the next frame.

BUG: 456511
parent d2899928
Pipeline #241977 passed with stage
in 27 minutes and 44 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment