[RFC xserver 0/3] Allow XWM to control Xwayland commits

Olivier Fourdan ofourdan at redhat.com
Fri Nov 25 08:47:56 UTC 2016


Hi Pekka,

> 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
> to
> have a use for it while brewing this), but I think it makes things look
> nicer.
> 
> The fundamental problem is that Xwayland and the Wayland compositor (window
> manager) are racing, particularly when windows are being mapped. This can
> lead
> 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
> Wayland
> 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
> carry
> fully drawn window decorations too.
> 
> This series is the Xwayland side of the fix to T7622. The Weston side is
> still
> 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 [1]

GNOME (mutter,gtk3) go a bit farther even and use an extended version of this protocol described by Owen [2].

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? 

Cheers,
Olivier

[1] https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472538288
[2] http://fishsoup.net/misc/wm-spec-synchronization.html
[3] https://bugzilla.gnome.org/show_bug.cgi?id=767212
[4] https://bugs.freedesktop.org/show_bug.cgi?id=81275


More information about the xorg-devel mailing list