Bug 501973

Summary: Session Restore fails to restore Snap-apps on X11 (with manual fix for restoring manually saved sessions)
Product: [Plasma] plasmashell Reporter: Jonas E <jegm>
Component: Session ManagementAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: kdedev, natalie_clarius
Priority: NOR    
Version First Reported In: 5.27.12   
Target Milestone: 1.0   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jonas E 2025-03-25 11:22:30 UTC
SUMMARY
Snap apps are not restored when restoring the session, regardless of using the "restore last session" or "Restore manually saved session". 
The problem seems to be related to a wrong path to the snap-bin written to .config/ksmserverrc and the bug can be manually fixed (see below).   

STEPS TO REPRODUCE
1. Open a Snap App (tested with Thunderbird, Obsidian and Firefox)
2. Either manually store the session and reboot, or reboot directly (depending on restore setting)
3. Login

OBSERVED RESULT
Snap App (e.g. Thunderbird) is not opened again.

EXPECTED RESULT
Snap App is restored and opens at the desktop.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 24.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13

ADDITIONAL INFORMATION
Manual fix: 
Snap applications are saved to the Block "LegacySession" in .config/.ksmserverrc, but the command saved is not working properly/as intended. Manually changing the command to the correct path/to/bin (evaluated by the which command) leads to the proper behaviour of the restore session, but is conceptually only a solution for restoring manually saved sessions.
Detailed steps for manual fix: 
1. Manually save the session as usual 
2. Open .config/.ksmserverrc. It should contain something like this: 
 [LegacySession: saved by user]
 clientMachine1=localhost
 command1=thunderbird-esr
 count=1
3. Correct command1 to actual path/to/bin, e.g.: 
 [LegacySession: saved by user]
 clientMachine1=localhost
 command1=/usr/bin/thunderbird
 count=1
4. Save file and reboot -> Restore session now works.
Comment 1 TraceyC 2025-03-25 21:49:00 UTC
Thanks for reporting this bug. This had been reported in bug 497520, so I'm going to add your details to that one and mark this as a duplicate.

*** This bug has been marked as a duplicate of bug 497520 ***