xserver: Branch 'master' - 2 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jun 19 22:11:43 UTC 2019
hw/xwayland/xwayland.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
New commits:
commit b3f3d65ed302baf78befe45eed458e666e1ff143
Author: Olivier Fourdan <ofourdan at redhat.com>
Date: Wed Jun 19 09:19:24 2019 +0200
xwayland: Add "-listenfd" option
Using the existing command line option "-listen" for passing file
descriptors between the Wayland compositor and Xwayland is misleading,
Xwayland should add is own command line option for that specific use.
As XWayland is spawned by the Wayland compositor, we cannot just change
the option, as that would break all existing Wayland compositors using
Xwayland, so we add a new options "-listenfd" and mark the previous one
as deprecated and log a warning, but it still works for backward
compatibility.
Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
https://gitlab.freedesktop.org/xorg/xserver/merge_requests/214
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 72b2be1b6..fe8b1abdc 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -98,7 +98,8 @@ ddxUseMsg(void)
{
ErrorF("-rootless run rootless, requires wm support\n");
ErrorF("-wm fd create X client for wm on given fd\n");
- ErrorF("-listen fd add give fd as a listen socket\n");
+ ErrorF("-listenfd fd add give fd as a listen socket\n");
+ ErrorF("-listen fd deprecated, use \"-listenfd\" instead\n");
ErrorF("-eglstream use eglstream backend for nvidia GPUs\n");
}
@@ -106,6 +107,17 @@ static int wm_fd = -1;
static int listen_fds[5] = { -1, -1, -1, -1, -1 };
static int listen_fd_count = 0;
+static void
+xwl_add_listen_fd(int argc, char *argv[], int i)
+{
+ NoListenAll = TRUE;
+ if (listen_fd_count == ARRAY_SIZE(listen_fds))
+ FatalError("Too many -listen arguments given, max is %zu\n",
+ ARRAY_SIZE(listen_fds));
+
+ listen_fds[listen_fd_count++] = atoi(argv[i + 1]);
+}
+
int
ddxProcessArgument(int argc, char *argv[], int i)
{
@@ -119,12 +131,16 @@ ddxProcessArgument(int argc, char *argv[], int i)
if (!isdigit(*argv[i + 1]))
return 0;
- NoListenAll = TRUE;
- if (listen_fd_count == ARRAY_SIZE(listen_fds))
- FatalError("Too many -listen arguments given, max is %zu\n",
- ARRAY_SIZE(listen_fds));
+ LogMessage(X_WARNING, "Option \"-listen\" for file descriptors is deprecated\n"
+ "Please use \"-listenfd\" instead.\n");
+
+ xwl_add_listen_fd (argc, argv, i);
+ return 2;
+ }
+ else if (strcmp(argv[i], "-listenfd") == 0) {
+ CHECK_FOR_REQUIRED_ARGUMENTS(1);
- listen_fds[listen_fd_count++] = atoi(argv[i + 1]);
+ xwl_add_listen_fd (argc, argv, i);
return 2;
}
else if (strcmp(argv[i], "-wm") == 0) {
commit 4a287cc2b6d849c29b43af07d93fa0048d8d6e90
Author: Olivier Fourdan <ofourdan at redhat.com>
Date: Tue Jun 18 10:41:02 2019 +0200
xwayland: Allow for regular transport types for listen
Xwayland uses the command line option “-listen” to pass file descriptors
from the Wayland compositor.
That breaks the traditional, documented behavior of the “-listen”
command line option which is to enable a transport type.
Checks if the given option starts with a digit, otherwise treat it as a
regular transport type.
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/817
Suggested-by: Rodrigo Exterckötter Tjäder
Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 739f86cf1..72b2be1b6 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -115,6 +115,10 @@ ddxProcessArgument(int argc, char *argv[], int i)
else if (strcmp(argv[i], "-listen") == 0) {
CHECK_FOR_REQUIRED_ARGUMENTS(1);
+ /* Not an FD */
+ if (!isdigit(*argv[i + 1]))
+ return 0;
+
NoListenAll = TRUE;
if (listen_fd_count == ARRAY_SIZE(listen_fds))
FatalError("Too many -listen arguments given, max is %zu\n",
More information about the xorg-commit
mailing list