Refresh a retained portal when starting a Ferese session

This commit is contained in:
Samuel Onoja committed 2026-09-28 11:41:07 +01:00
1 parent 9754326f1d
commit 84b03be53e
3 files changed
+10 -2

No files matched your search

+3 -1
View File
@@ -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
+4
View File
@@ -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
+3 -1
View File
@@ -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)