Skip to content

Commit

Permalink
add wrapper that immitates Xvfb using weston + Xwayland (#4450)
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jan 1, 2025
1 parent dc7e2c7 commit d96cdc8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions fs/libexec/xpra/xpra_weston_xvfb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

unset DISPLAY
export WAYLAND_DISPLAY=headless-$$
weston --backend=headless-backend.so --socket=$WAYLAND_DISPLAY &
Xwayland -noreset $@
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,9 @@ def add_service_exe(script, icon, base_name):
libexec_scripts += ["xdg-open", "gnome-open", "gvfs-open"]
if server_ENABLED:
libexec_scripts.append("auth_dialog")
if x11_ENABLED:
libexec_scripts.append("xpra_weston_xvfb")

def add_data_files(target_dir, files):
assert isinstance(target_dir, str)
assert isinstance(files, (list, tuple))
Expand All @@ -1796,7 +1799,7 @@ def add_data_files(target_dir, files):
libexec_dir = "__LIBEXECDIR__"
else:
libexec_dir = "libexec"
add_data_files(libexec_dir+"/xpra/", [f"fs/libexec/xpra/{x}" for x in libexec_scripts])

if data_ENABLED:
man_path = "share/man"
icons_dir = "icons"
Expand Down Expand Up @@ -1967,6 +1970,9 @@ def addconf(name, dst_name=None):
for etc_dir in ("http-headers", "content-type", "content-categories", "content-parent"):
dirtodir(f"fs/etc/xpra/{etc_dir}", f"/etc/xpra/{etc_dir}")

for libexec_script in libexec_scripts:
copytodir(f"fs/libexec/xpra/{libexec_script}", libexec_dir+"/xpra/", chmod=0o755)

# add build_conf to build step
cmdclass.update({
'build' : build_override,
Expand Down
6 changes: 6 additions & 0 deletions xpra/scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ def detect_xvfb_command(conf_dir:str="/etc/xpra/", bin_dir:str="",

if Xdummy_ENABLED is None:
debug("Xdummy support unspecified, will try to detect")
# RHEL 10 needs to use `xpra_weston_xvfb` instead of Xorg:
if os.path.exists("/etc/redhat-release"):
with open("/etc/redhat-release") as f:
relinfo = f.read()
if relinfo.find("release 10") >= 0:
return ["/usr/libexec/xpra/xpra_weston_xvfb"]
return detect_xdummy_command(conf_dir, bin_dir, Xdummy_wrapper_ENABLED, warn_fn)

def detect_xdummy_command(conf_dir:str="/etc/xpra/", bin_dir:str="",
Expand Down

0 comments on commit d96cdc8

Please sign in to comment.