From 49d31b9cad2b21fd4b29385fad779c9b32746ad8 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 10 Jun 2026 19:33:54 +0000 Subject: [PATCH] fix(headless-kde): --no-block the portal restart so bring-up isn't blocked ~30s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A synchronous systemctl try-restart of the portal chain (xdg-desktop-portal is Type=dbus, waits for its bus name) blocked the script ~30-40s before plasmashell started. --no-block queues the restart and returns immediately — the portal only needs to be ready before the first client streams (seconds later), not before plasmashell. Validated: plasmashell up in 1s (was ~30s); a virtual capture session against the fresh session streamed 720/720 frames @720p120, zero-copy CUDA, no black screen. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/headless/run-headless-kde.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/headless/run-headless-kde.sh b/scripts/headless/run-headless-kde.sh index 04cbeab..614950f 100755 --- a/scripts/headless/run-headless-kde.sh +++ b/scripts/headless/run-headless-kde.sh @@ -72,7 +72,11 @@ echo "KWin ready." # without it the restarted portal can inherit an empty WAYLAND_DISPLAY), then restart. systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR 2>/dev/null || true dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DBUS_SESSION_BUS_ADDRESS 2>/dev/null || true -systemctl --user try-restart plasma-xdg-desktop-portal-kde.service xdg-desktop-portal-kde.service xdg-desktop-portal.service 2>/dev/null || true +# --no-block: queue the restart and return immediately. A synchronous try-restart of the +# portal chain blocks bring-up ~30s (xdg-desktop-portal is Type=dbus and waits for its bus +# name); the portal only needs to be ready before the FIRST client streams (seconds later, +# user-driven), not before plasmashell starts. +systemctl --user --no-block try-restart plasma-xdg-desktop-portal-kde.service xdg-desktop-portal-kde.service xdg-desktop-portal.service 2>/dev/null || true kbuildsycoca6 >/dev/null 2>&1 || true # rebuild the menu cache under the correct env plasmashell &