xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 14 16:16:48 UTC 2020


 hw/xwayland/xwayland.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 4709d24f8e3ef5ee79085b77401eaacd7e1690c7
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Fri Feb 14 15:20:59 2020 +0100

    xwayland: Add version command line option
    
    Xorg supports the '-version' command line option, add something similar
    to Xwayland.
    
    Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/976
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Jonas Ådahl <jadahl at gmail.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index cb8df2972..380c9c849 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -37,6 +37,7 @@
 #include <os.h>
 #include <xserver_poll.h>
 #include <propertyst.h>
+#include <version-config.h>
 
 #include "xwayland-screen.h"
 #include "xwayland-vidmode.h"
@@ -89,6 +90,7 @@ ddxUseMsg(void)
     ErrorF("-listenfd fd           add given fd as a listen socket\n");
     ErrorF("-listen fd             deprecated, use \"-listenfd\" instead\n");
     ErrorF("-eglstream             use eglstream backend for nvidia GPUs\n");
+    ErrorF("-version               show the server version and exit\n");
 }
 
 static int init_fd = -1;
@@ -96,6 +98,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_show_version(void)
+{
+    ErrorF("%s Xwayland %s (%d)\n", VENDOR_NAME, VENDOR_MAN_VERSION, VENDOR_RELEASE);
+    ErrorF("X Protocol Version %d, Revision %d\n", X_PROTOCOL, X_PROTOCOL_REVISION);
+#if defined(BUILDERSTRING)
+    if (strlen(BUILDERSTRING))
+        ErrorF("%s\n", BUILDERSTRING);
+#endif
+}
+
 static void
 xwl_add_listen_fd(int argc, char *argv[], int i)
 {
@@ -148,6 +161,10 @@ ddxProcessArgument(int argc, char *argv[], int i)
     else if (strcmp(argv[i], "-eglstream") == 0) {
         return 1;
     }
+    else if (strcmp(argv[i], "-version") == 0) {
+        xwl_show_version();
+        exit(0);
+    }
 
     return 0;
 }


More information about the xorg-commit mailing list