Use allow commits to fix black shadows on resize

Merged Olivier Fourdan requested to merge ofourdan/mutter:set-allow-commits into master

Xwayland may post damages for an X11 window as soon as the frame callback is triggered, while the X11 window manager/compositor has not yet finished updating the windows.

If Xwayland becomes compliant enough to not permit updates after the buffer has been committed (see [1]), then the partial redraw of the X11 window at the time it was posted will show on screen.

To avoid that issue, the X11 window manager can use the X11 property _XWAYLAND_ALLOW_COMMITS to control when Xwayland should be allowed to post the pending damages.

Add the set_allow_commits() method to MetaWindow which is a no-op on plain X11 and native Wayland windows, and sets _XWAYLAND_ALLOW_COMMITS on the toplevel X11 window on Xwayland.

Then hint Xwayland as to when it can post pending damages and commit the Wayland buffer using the set_allow_commits() API, based on window actor freeze/thaw.

[1] See-also: !855 (closed)

Edited by Olivier Fourdan

Merge request reports