Skip to content

Commit

Permalink
pyvirtualdisplay is only needed on Linux when not in headless mode
Browse files Browse the repository at this point in the history
Signed-off-by: timelyart <[email protected]>
  • Loading branch information
timelyart committed Jul 9, 2023
1 parent 1ee3f2b commit a2f5b6c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tv/tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3194,13 +3194,14 @@ def create_browser(run_in_background, resolution='1920,1080', download_path=None
browser = None
for capability in capabilities:
options.set_capability(capability, capabilities[capability])
if OS == 'linux' and \
config.has_option('webdriver', 'use_proxy_display') and config.getboolean('webdriver', 'use_proxy_display'):
if OS == 'linux' and not run_in_background and \
config.has_option('webdriver', 'use_proxy_display') and \
config.getboolean('webdriver', 'use_proxy_display'):
from pyvirtualdisplay import Display
global DISPLAY
# visible == false -> runs over xfvb
# visible == true -> runs over xephyr
DISPLAY = Display(visible=not run_in_background, size=(1920, 1024))
DISPLAY = Display(visible=True, size=(1920, 1024))
DISPLAY.start()

try:
Expand Down

0 comments on commit a2f5b6c

Please sign in to comment.