+ wayland_display = session["wayland_display"] = "wayland-0"
+
+ if os.path.isabs(wayland_display):
+ wayland_socket_path = wayland_display
+ else:
+ xdg_runtime_dir = session["xdg_runtime_dir"]
+ if xdg_runtime_dir == "None" or not xdg_runtime_dir:
+ logging.error(f"XDG_RUNTIME_DIR is not set; please don't start a Waydroid session with 'sudo'!")
+ sys.exit(1)
+ wayland_socket_path = os.path.join(xdg_runtime_dir, wayland_display)
+ if not os.path.exists(wayland_socket_path):
+ logging.error(f"Wayland socket '{wayland_socket_path}' doesn't exist; are you running a Wayland compositor?")
+ sys.exit(1)
+