[RFC xserver 0/3] Allow XWM to control Xwayland commits
ofourdan at redhat.com
Fri Nov 25 08:47:56 UTC 2016
> this is probably the first time I'm sending patches for the xserver, so
> pointing out API misuse, coding style issues etc. would be appreciated. The
> last patch also has some XXX comments with questions.
> The first patch, refactoring, is not absolutely necessary (anymore - I used
> have a use for it while brewing this), but I think it makes things look
> The fundamental problem is that Xwayland and the Wayland compositor (window
> manager) are racing, particularly when windows are being mapped. This can
> to glitches. The specific glitch I bumped into is described at
> https://phabricator.freedesktop.org/T7622 .
> The proposed solution allows the WM to temporarily prohibit commits.
> It would be awkward for Weston to postpone mapping certain windows since it
> would leak quite much Xwayland into the heart of the window manager. A
> compositor also cannot ignore commits, because Xwayland will wait for frame
> callbacks until it commits again. To not get stuck, one would need to fire
> frame callbacks outside of their normal path. It seems much simpler to just
> control Xwayland's commits, which also ensures that the first commit will
> fully drawn window decorations too.
> This series is the Xwayland side of the fix to T7622. The Weston side is
> brewing, but I was able to test that the Xwayland code works.
I've taken a look at https://phabricator.freedesktop.org/T7622 but I am not sure how that proposal would play with apps that implement the _NET_WM_SYNC protocol, using _NET_WM_SYNC_REQUEST and sync counters as described in EMWH 
GNOME (mutter,gtk3) go a bit farther even and use an extended version of this protocol described by Owen .
I suspect these make the de-syncronization with the Xwayland toplevel decorated by the X window manager even more visible under Wayland, as the repaint is scheduled according to the app content and not sync'ed with Xwayland and repaint of the shadows by the XWM.
Would your proposal help there?
More information about the xorg-devel