[Xcb] Odd behavior with damage events and override-redirect windows

Jess VanDerwalker washu at sonic.net
Mon Jul 16 14:27:44 PDT 2012

I'm working on a library to support compositing window managers which
uses damage to report the areas of a window that need to be updated:

I've found a possible issue with the reporting of damage events
and override redirect windows, but would like a sanity check to make
sure I'm not missing something simple.

When a client maps a window, I catch that event, register the window,
and create a damage "object" for it with xcb_damage_create and a
damage reporting level of XCB_DAMAGE_REPORT_LEVEL_BOUNDING_BOX. When a
damage event occurs, it's caught and the passed on so the window
manager can then get the pixmap for the damaged area and draw it to
the screen. The coordinates for the damaged area are relative to the
window. Once the window is redrawn, the damage is subtracted.

This works correctly for non-override redirect windows. But something
odd occurs with window flagged as override redirect. In that case, the
coordinates for the window are root relative, not window relative. As
an example, if the override redirect window is mapped with x=10, y=10,
width=100, height=100 the first damage event (which is a complete
drawing of the window) would report a damage area of x=10, y=10,
width=100, height=100.

The really odd thing is that this is only true for the *initial*
damage event, subsequent damage events are reported in window relative
coordinates. Except when their not, which it where it gets really
odd. It seems that sometimes, I'll also get damage events that give
coordinates where the window x gets added to the width. Going back to
the previous example, a completely damaged window would report a
damage area of x=0, y=0, width=110, height=100. This is neither root
or window relative.

Please let me know if there is other information required that
would make the above clearer or easier to diagnose.

- Jess VanDerwalker

More information about the Xcb mailing list