Excerpts from Tomeu Vizoso's message of Wed May 19 12:34:57 +0000 2010:

> From: Tomeu Vizoso <to...@sugarlabs.org>
> 
> ---

Please provide a more complete patch description. Only after Bernie
posted his version of your patch did I understand what the point of it was.

[src/jarabe/util/emulator.py]
> @@ -152,11 +150,14 @@ def main():
>  
>      _setup_env()
>  
> -    server = _start_xephyr(options.dpi, options.dimensions, 
> options.fullscreen)
> +    server, display = _start_xephyr(options.dpi, options.dimensions, 
> options.fullscreen)
>      if not server:
>          sys.stderr.write('Failed to start server.\n')
>          return ERROR_NO_SERVER
>  
> +    os.environ['DISPLAY'] = ":%d" % (display)
> +    os.environ['SUGAR_EMULATOR_PID'] = str(server.pid)
> +
>      if options.scaling:
>          os.environ['SUGAR_SCALING'] = options.scaling
>  

I'd prefer DISPLAY and SUGAR_EMULATOR_PID to be set in _setup_env(). In fact
that's the way I already did it in my VNC branch:

def _setup_env(display, scaling):
    """Set up environment variables for running Sugar inside the new X server.
    """
    os.environ['SUGAR_EMULATOR'] = 'yes'
    os.environ['GABBLE_LOGFILE'] = os.path.join(
            env.get_profile_path(), 'logs', 'telepathy-gabble.log')
    os.environ['SALUT_LOGFILE'] = os.path.join(
            env.get_profile_path(), 'logs', 'telepathy-salut.log')
    os.environ['STREAM_ENGINE_LOGFILE'] = os.path.join(
            env.get_profile_path(), 'logs', 'telepathy-stream-engine.log')
    os.environ['DISPLAY'] = ':%d' % (display, )
    if scaling:
        os.environ['SUGAR_SCALING'] = scaling

[...]

def main():
    """Script-level operations"""
    global server

    options, args = _parse_args()
    display, server = _start_server(options.dpi, options.dimensions,
        options.fullscreen)
    viewer = _start_viewer(display, options.fullscreen)
    _setup_env(display, options.scaling)
[...]

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to