[PATCH v6 RFC 01/10] ephyr: allow passing explictly host X server display number and/or authorization file path

Laércio de Sousa laerciosousa at sme-mogidascruzes.sp.gov.br
Tue Sep 22 06:39:33 PDT 2015


I'm not endorsing this patch anymore. It could be perfectly replaced with
other approaches:

  * Rely on DM settings to set DISPLAY/XAUTHORITY variables

  * Set custom command "env DISPLAY=(...) XAUTHORITY=(...) Xephyr (...)" in
DM settings

Since patch 08/10 has already been merged, patches 02-07/10 and 09,10/10
still need to be reviewed.

2015-09-03 15:00 GMT-03:00 Laércio de Sousa <
laerciosousa at sme-mogidascruzes.sp.gov.br>:

> This patch introduces two command-line options for Xephyr:
>
>   * -host-display: set Xephyr DISPLAY environment variable
>                    to host X server display number
>   * -host-auth:    set Xephyr XAUTHORITY environment variable
>                    to host X server authorization file path
>
> These options are particularly useful when Xephyr is launched
> directly from display manager, because DISPLAY and/or XAUTHORITY
> environment variables may not be set when it's launched.
>
> Signed-off-by: Laércio de Sousa <laerciosousa at sme-mogidascruzes.sp.gov.br>
> ---
>  hw/kdrive/ephyr/ephyrinit.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
> index 8fbaf1d..0a42c96 100644
> --- a/hw/kdrive/ephyr/ephyrinit.c
> +++ b/hw/kdrive/ephyr/ephyrinit.c
> @@ -141,6 +141,8 @@ ddxUseMsg(void)
>      KdUseMsg();
>
>      ErrorF("\nXephyr Option Usage:\n");
> +    ErrorF("-host-display        host X server display number\n");
> +    ErrorF("-host-auth           host X server authorization file
> path\n");
>      ErrorF("-parent <XID>        Use existing window as Xephyr root
> win\n");
>      ErrorF("-sw-cursor           Render cursors in software in Xephyr\n");
>      ErrorF("-fullscreen          Attempt to run Xephyr fullscreen\n");
> @@ -369,6 +371,24 @@ ddxProcessArgument(int argc, char **argv, int i)
>          EphyrWantNoHostGrab = 1;
>          return 2;
>      }
> +    else if (!strcmp(argv[i], "-host-display")) {
> +        if (i + 1 < argc) {
> +            setenv("DISPLAY", argv[i + 1], 1);
> +            return 2;
> +        }
> +
> +        UseMsg();
> +        exit(1);
> +    }
> +    else if (!strcmp(argv[i], "-host-auth")) {
> +        if (i + 1 < argc) {
> +            setenv("XAUTHORITY", argv[i + 1], 1);
> +            return 2;
> +        }
> +
> +        UseMsg();
> +        exit(1);
> +    }
>
>      return KdProcessArgument(argc, argv, i);
>  }
> --
> 2.5.0
>
>


-- 
*Laércio de Sousa*
*Orientador de Informática*
*Escola Municipal "Professor Eulálio Gruppi"*
*Rua Ismael da Silva Mello, 559, Mogi Moderno*
*Mogi das Cruzes - SPCEP 08717-390*
Telefone: (11) 4726-8313
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150922/a7fc2749/attachment.html>


More information about the xorg-devel mailing list