Allow xwayland to start lazily

Makes the xwayland startup process two phased.
The first phase just initialises the X11 sockets.
The second phase starts the Xwayland server itself.
When starting xwayland lazily the second phase will be postponed until
a client has connected to the X11 socket.

Changes in behaviour:
The DISPLAY environment is now set immediately after the X11 sockets
are created.
When the Xwayland server is killed or crashes, the sockets will not be
recreated, but reused.

Fixes #849: Start up Xwayland lazily
This commit is contained in:
Vincent Vanlaer 2018-05-06 20:23:10 +02:00
parent 2959fcce1a
commit c80bf1591e
3 changed files with 101 additions and 43 deletions

View file

@ -835,7 +835,7 @@ struct roots_desktop *desktop_create(struct roots_server *server,
if (config->xwayland) {
desktop->xwayland = wlr_xwayland_create(server->wl_display,
desktop->compositor);
desktop->compositor, false);
wl_signal_add(&desktop->xwayland->events.new_surface,
&desktop->xwayland_surface);
desktop->xwayland_surface.notify = handle_xwayland_surface;