xwayland: Allow passing a fd for set up clients
This FD also triggers the "wait for WM_S0" paths, so that the compositor may set up a "maintenance line" for Xwayland, for services that are essential to run before any client (eg. xrdb). Those services would use this FD, disguised as an extra display connection. This -initfd can be seen as a generalization of -wm, a Wayland compositor may use -initfd to launch its WM and any other clients that should start up, or it may use -wm as a dedicated connection for the WM and optionally use -initfd for the misc. startup clients. If either of -wm or -initfd is passed, Xwayland will expect a selection notification on WM_S0 before incorporating the FDs in -listen to the poll list. Also, correct a minor typo in the listenfd argument output, give → given. Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
This commit is contained in:
parent
78cc8b6f96
commit
7ad1d0d384
|
@ -98,11 +98,13 @@ ddxUseMsg(void)
|
||||||
{
|
{
|
||||||
ErrorF("-rootless run rootless, requires wm support\n");
|
ErrorF("-rootless run rootless, requires wm support\n");
|
||||||
ErrorF("-wm fd create X client for wm on given fd\n");
|
ErrorF("-wm fd create X client for wm on given fd\n");
|
||||||
ErrorF("-listenfd fd add give fd as a listen socket\n");
|
ErrorF("-initfd fd add given fd as a listen socket for initialization clients\n");
|
||||||
|
ErrorF("-listenfd fd add given fd as a listen socket\n");
|
||||||
ErrorF("-listen fd deprecated, use \"-listenfd\" instead\n");
|
ErrorF("-listen fd deprecated, use \"-listenfd\" instead\n");
|
||||||
ErrorF("-eglstream use eglstream backend for nvidia GPUs\n");
|
ErrorF("-eglstream use eglstream backend for nvidia GPUs\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int init_fd = -1;
|
||||||
static int wm_fd = -1;
|
static int wm_fd = -1;
|
||||||
static int listen_fds[5] = { -1, -1, -1, -1, -1 };
|
static int listen_fds[5] = { -1, -1, -1, -1, -1 };
|
||||||
static int listen_fd_count = 0;
|
static int listen_fd_count = 0;
|
||||||
|
@ -148,6 +150,11 @@ ddxProcessArgument(int argc, char *argv[], int i)
|
||||||
wm_fd = atoi(argv[i + 1]);
|
wm_fd = atoi(argv[i + 1]);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[i], "-initfd") == 0) {
|
||||||
|
CHECK_FOR_REQUIRED_ARGUMENTS(1);
|
||||||
|
init_fd = atoi(argv[i + 1]);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
else if (strcmp(argv[i], "-shm") == 0) {
|
else if (strcmp(argv[i], "-shm") == 0) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1287,10 +1294,14 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv)
|
||||||
|
|
||||||
LocalAccessScopeUser();
|
LocalAccessScopeUser();
|
||||||
|
|
||||||
if (wm_fd >= 0) {
|
if (wm_fd >= 0 || init_fd >= 0) {
|
||||||
TimerSet(NULL, 0, 1, add_client_fd, NULL);
|
if (wm_fd >= 0)
|
||||||
|
TimerSet(NULL, 0, 1, add_client_fd, NULL);
|
||||||
|
if (init_fd >= 0)
|
||||||
|
ListenOnOpenFD(init_fd, FALSE);
|
||||||
AddCallback(&SelectionCallback, wm_selection_callback, NULL);
|
AddCallback(&SelectionCallback, wm_selection_callback, NULL);
|
||||||
} else if (listen_fd_count > 0) {
|
}
|
||||||
|
else if (listen_fd_count > 0) {
|
||||||
listen_on_fds();
|
listen_on_fds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user