xwayland: Add -verbose option as in xfree86

Makes it easier to debug Xwayland problems.

Signed-off-by: Misha Gusarov <dottedmag@dottedmag.net>
This commit is contained in:
Misha Gusarov 2021-01-27 12:37:51 +00:00 committed by Olivier Fourdan
parent 0148a15da1
commit 4341f1da72
3 changed files with 27 additions and 0 deletions

View File

@ -75,6 +75,15 @@ to be an X window manager as well.
Force the shared memory backend instead of glamor (if available) for passing Force the shared memory backend instead of glamor (if available) for passing
buffers to the Wayland server. buffers to the Wayland server.
.TP 8 .TP 8
.BR \-verbose " [\fIn\fP]"
Sets the verbosity level for information printed on stderr. If the
.I n
value isn't supplied, each occurrence of this option increments the
verbosity level. When the
.I n
value is supplied, the verbosity level is set to that value. The default
verbosity level is 0.
.TP 8
.BI \-version .BI \-version
Show the server version and exit. Show the server version and exit.
.TP 8 .TP 8

View File

@ -93,6 +93,7 @@ ddxUseMsg(void)
ErrorF("-eglstream use eglstream backend for nvidia GPUs\n"); ErrorF("-eglstream use eglstream backend for nvidia GPUs\n");
#endif #endif
ErrorF("-shm use shared memory for passing buffers\n"); ErrorF("-shm use shared memory for passing buffers\n");
ErrorF("-verbose [n] verbose startup messages\n");
ErrorF("-version show the server version and exit\n"); ErrorF("-version show the server version and exit\n");
} }
@ -100,6 +101,7 @@ 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;
static int verbosity = 0;
static void static void
xwl_show_version(void) xwl_show_version(void)
@ -161,6 +163,21 @@ ddxProcessArgument(int argc, char *argv[], int i)
else if (strcmp(argv[i], "-shm") == 0) { else if (strcmp(argv[i], "-shm") == 0) {
return 1; return 1;
} }
else if (strcmp(argv[i], "-verbose") == 0) {
if (++i < argc && argv[i]) {
char *end;
long val;
val = strtol(argv[i], &end, 0);
if (*end == '\0') {
verbosity = val;
LogSetParameter(XLOG_VERBOSITY, verbosity);
return 2;
}
}
LogSetParameter(XLOG_VERBOSITY, ++verbosity);
return 1;
}
else if (strcmp(argv[i], "-eglstream") == 0) { else if (strcmp(argv[i], "-eglstream") == 0) {
return 1; return 1;
} }

View File

@ -6,3 +6,4 @@ have_glamor=@have_glamor@
have_eglstream=@have_eglstream@ have_eglstream=@have_eglstream@
have_initfd=true have_initfd=true
have_listenfd=true have_listenfd=true
have_verbose=true