Session: wait for the document portal's mount before reopening apps; say when it's broken
CI / test (push) Canceled after 1m11s
CI / test (push) Canceled after 1m11s
V's session.log had kwi (a Flatpak) failing with "bwrap: Can't find source path /run/user/1000/doc/by-app/org.kde.kwi". At login chandra-session restarts xdg-desktop-portal, and xdg-document-portal stopped and started with it in the same second (V's journal, 21:36:12); a Flatpak started in that gap, such as one session restore reopens, finds no FUSE mount to bind into its sandbox. When flatpak is installed, chandra-session now asks the document portal for its mount point (which also starts it), waits up to 5 s for the FUSE mount and checks it answers. If it doesn't, the reason goes to the log and into CHANDRA_SESSION_ERRORS, which the shell shows as an error notice once the desktop is up (DesktopShell::show_session_errors). A missing dbus-send is reported too. Tested: the snippet against a real xdg-document-portal on a dbus-run-session bus (mounted after 0 waits) and with an unreachable bus (error text); the notice in compositor/host/launch_test.mbt and headless with build/wasmhost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hiGJWeuHiTgtoyB4kb
This commit is contained in:
3 files changed
+62
No files matched your search
@@ -368,6 +368,23 @@ fn DesktopShell::ensure_booted(self : DesktopShell) -> Unit {
|
||||
ignore(self.load_path(path))
|
||||
}
|
||||
}
|
||||
self.show_session_errors(@sys.getenv("CHANDRA_SESSION_ERRORS"))
|
||||
}
|
||||
|
||||
///| Show what chandra-session found broken before the desktop started (CHANDRA_SESSION_ERRORS,
|
||||
/// one problem per line; the document portal Flatpak apps need, for one).
|
||||
pub fn DesktopShell::show_session_errors(self : DesktopShell, errors : String) -> Unit {
|
||||
let lines : Array[String] = []
|
||||
for l in errors.split("\n") {
|
||||
let t = l.trim(chars=" \t").to_string()
|
||||
if t != "" {
|
||||
lines.push(t)
|
||||
}
|
||||
}
|
||||
if lines.length() > 0 {
|
||||
lines.push("Found at login by chandra-session; details in ~/.local/state/chandra/session.log")
|
||||
self.say_error(lines)
|
||||
}
|
||||
}
|
||||
|
||||
///| Load the module file at `path` into the panel (any number of instances may be loaded).
|
||||
|
||||
Reference in new issue
Block a user