diff --git a/docs/installation.md b/docs/installation.md index 980a1d8..8a9048a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -19,7 +19,9 @@ session helper activates `ferese-session.target` after exporting the compositor' Wayland display, and stops it when the shell exits. This keeps `graphical-session.target` active so desktop portals can start. The native portal is D-Bus activated and supervised by systemd; it stops with the session so a -previous release cannot remain running after logout. Nested previews +previous release cannot remain running after logout. Session startup also refreshes +an already-running native portal after importing the current display environment. +Nested previews do not alter the host's activation environment or session targets. ### Fedora diff --git a/packaging/ferese-session-shell b/packaging/ferese-session-shell index c3d6629..1caeb76 100755 --- a/packaging/ferese-session-shell +++ b/packaging/ferese-session-shell @@ -38,6 +38,10 @@ if [[ ${FERESE_SESSION_IMPORT_ENV:-0} == 1 ]]; then systemctl --user daemon-reload || true if systemctl --user start ferese-session.target; then session_target_started=1 + # A user manager can retain the target across session transitions. + # Refresh an already-running portal after importing this session's + # environment so it uses the installed release and current display. + systemctl --user try-restart xdg-desktop-portal-ferese.service || true else echo 'Ferese: graphical session target could not start; portal activation may be unavailable.' >&2 fi diff --git a/scripts/tests/test_session_startup.py b/scripts/tests/test_session_startup.py index 71ca7ff..dc6d553 100644 --- a/scripts/tests/test_session_startup.py +++ b/scripts/tests/test_session_startup.py @@ -48,7 +48,8 @@ class SessionStartupTest(unittest.TestCase): status, events = self.run_session(shell_status=7) self.assertEqual(status, 7) self.assertEqual(events, ['import:public-display', 'reload-bus', '--user daemon-reload', - '--user start ferese-session.target', 'shell:77', + '--user start ferese-session.target', + '--user try-restart xdg-desktop-portal-ferese.service', 'shell:77', '--user stop ferese-session.target']) def test_nested_session_never_changes_host_activation(self): @@ -61,6 +62,7 @@ class SessionStartupTest(unittest.TestCase): self.assertEqual(status, 0) self.assertIn('shell:77', events) self.assertNotIn('--user stop ferese-session.target', events) + self.assertNotIn('--user try-restart xdg-desktop-portal-ferese.service', events) def test_termination_stops_the_session_target(self): status, events = self.run_session(terminate=True)