Lines Matching +full:monitor +full:- +full:script +full:- +full:pid
3 # Use of this source code is governed by a BSD-style license that can be
30 # pylint: disable=useless-object-inheritance
66 def launch_dbus(env): # pylint: disable=inconsistent-return-statements
70 async-signal-safe (in particular, memory allocations) between fork and exec
84 Returns the pid of the dbus-daemon if started, or None otherwise.
89 dbus_output = subprocess.check_output(['dbus-launch'],
90 env=env).decode('utf-8').split('\n')
119 stdoutfile: If provided, symbolization via script is disabled and stdout
132 # It might seem counterintuitive to support a --no-xvfb flag in a script
135 # this script by default and don't have to worry about the distinction, it
140 # better support for dummy drivers and multi-screen testing (See:
142 # (package: xserver-xorg-core)
146 if '--no-xvfb' in cmd:
149 cmd.remove('--no-xvfb')
152 if '--use-xvfb' in cmd:
154 print('Conflicting flags --use-xvfb and --no-xvfb\n', file=sys.stderr)
158 cmd.remove('--use-xvfb')
164 if '--use-weston' in cmd:
169 cmd.remove('--use-weston')
207 """Returns a list of tuples (width, height) for supported monitor resolutions.
210 # silently gets dropped which makes subsequent calls to xrandr --addmode fail.
229 Section "Monitor"
231 HorizSync 5.0 - 1000.0
232 VertRefresh 5.0 - 200.0
237 # Dummy driver requires package `xserver-xorg-video-dummy`.
244 Monitor "Monitor0"
252 'xorg-%s.config' % uuid.uuid4().hex)
270 # The minimum version of xserver-xorg-video-dummy is 0.4.0-1 which adds
274 dummy_displays_available = _re_search_command('DUMMY[0-9]', ['xrandr', '-q'],
283 call_xrandr(['--addmode', output_name, modeline_label])
287 args = ['--output', name, '--mode', default_mode_label]
289 args += ['--right-of', output_names[i - 1]]
292 # Sets the primary monitor to the default size and marks the rest as disabled.
293 call_xrandr(['-s', '%dx%d' % default_size])
295 call_xrandr(['--dpi', '96'])
323 # If it does fail, try again up to 10 times, similarly to xvfb-run.
330 x11_cmd = ['Xorg', display, '-noreset', '-config', xorg_config_file]
333 'Xvfb', display, '-screen', '0', xvfb_whd, '-ac', '-nolisten',
334 'tcp', '-dpi', '96', '+extension', 'RANDR', '-maxclients', '512'
365 # script it has started up.
368 # The CMD that is passed via the --startup flag.
369 openbox_startup_cmd = 'kill --signal SIGUSR1 %s' % str(current_proc_id)
377 ['openbox', '--sm-disable', '--startup', openbox_startup_cmd],
417 # dbus-daemon is not a subprocess, so we can't SIGTERM+waitpid() on it.
438 # //ui/ozone at all, but still have --use-weston flag set by the
453 # 1) panel-position=none - disables the panel, which might interfere with
456 weston_config_file.write('[shell]\npanel-position=none')
462 # 1) --backend=headless-backend.so - runs Weston in a headless mode
464 # 2) --idle-time=0 - disables idle timeout, which prevents Weston
466 # and tests start to time out (this typically happens after 300 seconds -
468 # 3) --modules=ui-controls.so,systemd-notify.so - enables support for the
469 # ui-controls Wayland protocol extension and the systemd-notify protocol.
470 # 4) --width && --height set size of a virtual display: we need to set
473 # 5) --config=... - tells Weston to use our custom config.
475 './weston', '--backend=headless-backend.so', '--idle-time=0',
476 '--modules=ui-controls.so,systemd-notify.so', '--width=1280',
477 '--height=800', '--config=' + _weston_config_file_path()
480 if '--weston-use-gl' in cmd:
482 weston_cmd.append('--use-gl')
483 cmd.remove('--weston-use-gl')
485 if '--weston-debug-logging' in cmd:
486 cmd.remove('--weston-debug-logging')
490 # We use the systemd-notify protocol to detect whether weston has launched
493 # systemd-notify module, weston will send a 'READY=1' message to the socket
495 # See the sd_notify(3) man page and weston's compositor/systemd-notify.c for
518 # systemd-notify module. This happens shortly before spawning its
519 # subprocesses (e.g. desktop-shell). Wait some more to ensure they
527 weston_proc_display = _get_display_from_weston(weston_proc.pid)
542 if '--chrome-wayland-debugging' in cmd:
543 cmd.remove('--chrome-wayland-debugging')
564 # dbus-daemon is not a subprocess, so we can't SIGTERM+waitpid() on it.
572 return os.path.join(tempfile.gettempdir(), '.xvfb.py-weston-notify.sock')
576 return os.path.join(tempfile.gettempdir(), '.xvfb.py-weston.ini')
637 """Iterates through X-lock files to find an available display number.
639 The lower bound follows xvfb-run standard at 99, and the upper bound
643 A string of a random available display number for Xvfb ':{99-119}'.
651 if not os.path.isfile('/tmp/.X{}-lock'.format(d))
662 runtime_dir = '/tmp/xdg-tmp-dir/'
669 usage = ('[command [--no-xvfb or --use-xvfb or --use-weston] args...]\n'
670 '\t --no-xvfb\t\tTurns off all X11 backings (Xvfb and Xorg).\n'
671 '\t --use-xvfb\t\tForces legacy Xvfb backing instead of Xorg.\n'
672 '\t --use-weston\t\tEnable Wayland server.')
673 # TODO(crbug.com/326283384): Argparse-ify this.