Bug 436318

Summary: Save session doesn't work under Wayland
Product: [Plasma] ksmserver Reporter: Patrick O'Callaghan <pocallaghan>
Component: generalAssignee: David Edmundson <kde>
Status: CONFIRMED ---    
Severity: normal CC: agurenko, alex765, andihartmann, anssi.hannula, auxsvr, bednarczyk.pawel, bernie, cdennett, chris, cribari, cruzki123, desw, dkxls23, edtoml, endymion+kde, equeim, etaash.mathamsetty, eugene.shalygin+bugzilla.kde, funtoos, imaginator, jbuchert+kdebugs, jhs, johannes.hirte, john.ettedgui, kishore96, L.Bonnaud, mail, mauromol, msdobrescu, nate, ndrzj1gbo, nico.kruber, niklas, nortexoid, piotr.mierzwinski, plasma-bugs, postix, rdieter, sam, sandysareon, shtetldik, smit17av, tuppa+kde, xqgrhiovxf6bw12h
Priority: NOR Keywords: wayland
Version: 5.24.4   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Patrick O'Callaghan 2021-04-28 16:11:50 UTC
SUMMARY
After configuring session-restore on login, then saving the session, many items are missing after starting a new session.

STEPS TO REPRODUCE
1. Enable "Manually saved session"
2. Set up some apps including Firefox, Konsole, Dolphin
3. Save the session using the Leave button

OBSERVED RESULT
On logging in again, neither Dolphin nor Konsole windows are restored. Firefox is restored.

EXPECTED RESULT
All saved windows should be restored.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Fedora 34
(available in About System)
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2021-04-28 19:36:34 UTC
Already noted on https://community.kde.org/Plasma/Wayland_Showstoppers.

We can use this as the bug report to track it.
Comment 2 Nate Graham 2021-09-14 15:07:58 UTC
*** Bug 442192 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2021-09-16 17:51:46 UTC
*** Bug 442283 has been marked as a duplicate of this bug. ***
Comment 4 devsk 2022-04-18 06:53:30 UTC Comment hidden (spam)
Comment 5 Nate Graham 2022-04-18 14:29:15 UTC Comment hidden (spam)
Comment 6 Nate Graham 2022-05-16 18:46:11 UTC
*** Bug 453849 has been marked as a duplicate of this bug. ***
Comment 7 Etaash Mathamsetty 2022-06-10 02:21:17 UTC Comment hidden (spam)
Comment 8 David Redondo 2022-06-10 07:15:22 UTC
*** Bug 455105 has been marked as a duplicate of this bug. ***
Comment 9 David Edmundson 2022-06-27 11:10:43 UTC
*** Bug 455900 has been marked as a duplicate of this bug. ***
Comment 10 Shmerl 2022-06-29 04:50:24 UTC
So something like this will eventually be able to help it? https://www.youtube.com/watch?v=fRdnRwPBFBk
Comment 11 Francisco Cribari 2022-07-29 11:27:38 UTC Comment hidden (spam)
Comment 12 Nate Graham 2022-07-29 15:36:14 UTC Comment hidden (spam)
Comment 13 Armin 2022-08-30 06:46:51 UTC Comment hidden (spam)
Comment 14 Piotr Mierzwinski 2022-08-30 17:44:31 UTC Comment hidden (spam)
Comment 15 Nate Graham 2022-08-30 17:51:04 UTC Comment hidden (spam)
Comment 16 Piotr Mierzwinski 2022-08-30 20:13:15 UTC Comment hidden (spam)
Comment 17 Nate Graham 2022-08-30 20:15:58 UTC Comment hidden (spam)
Comment 18 Piotr Mierzwinski 2022-09-02 21:15:32 UTC Comment hidden (spam)
Comment 19 Nate Graham 2022-09-02 21:46:18 UTC Comment hidden (spam)
Comment 20 devsk 2022-09-30 18:15:36 UTC
(In reply to Nate Graham from comment #19)
> In general, Plasma has enough testers and QA people. What it lacks is enough
> developers to fix all the issues those people find.

Or the devs you already have are interested only in next shiny thing than to fix bugs in their code...:-) Sure, we can't force devs to stick around forever and fix bugs in their code but sometimes, its good to stop new development and just fix the bugs. You will have more adoption and participation, and that can potentially get you more devs.
Comment 21 Bernie Innocenti 2022-09-30 18:57:11 UTC
(In reply to devsk from comment #20)
> Or the devs you already have are interested only in next shiny thing than to
> fix bugs in their code...:-) Sure, we can't force devs to stick around
> forever and fix bugs in their code but sometimes, its good to stop new
> development and just fix the bugs. You will have more adoption and
> participation, and that can potentially get you more devs.

As a user, I also wish session restore to worked on Wayland, but inflammatory comments won't help expedite it.

I would like to know what's making this difficult. X11 had a session management protocol; does Wayland define something equivalent? If not, could Plasma do something limited to KDE apps?

Where is the current session save/restore code? Any documentation we could link in this bug to support someone who wants to give a shot at it?
Comment 22 devsk 2022-09-30 19:15:29 UTC
(In reply to Bernie Innocenti from comment #21)
> (In reply to devsk from comment #20)
> > Or the devs you already have are interested only in next shiny thing than to
> > fix bugs in their code...:-) Sure, we can't force devs to stick around
> > forever and fix bugs in their code but sometimes, its good to stop new
> > development and just fix the bugs. You will have more adoption and
> > participation, and that can potentially get you more devs.
> 
> As a user, I also wish session restore to worked on Wayland, but
> inflammatory comments won't help expedite it.

I swear inflammation was not the intention. But truth can be hard sometimes and it lands wrongly in written communications. My apologies if it sounded like that.

It is true that devs like to move onto newer things. I see it everyday at work. And good teams and leaders have to bring them back to the table. We have burnt sprints doing just bug fixes solely because of this. And it works! The overall quality of the code improves and customers are happier and they spread the good word!
Comment 23 Ard van der Marel 2022-10-01 12:53:02 UTC
For me, with x11 applications running under x11 ad Wayland, it just seems to be a app startup mechanism. xcalc for example doesn't remain state after logging out. The observed result has been found because Firefox has a option to reopen the pages that were closed during the shutdown of Firefox. Therefore i think changing restore to reopen would be more accurate and a more concrete path to a solution.

after the user ends session by logging out, rebooting, etc. Before closing the applications, the paths of the open applications should be saved to a (session) file from where these can be opened.

I would be interested to know how the x11 application reopen is done in Wayland as hopefully some of the solution can be reused or be expanded on to include Wayland applications. Im not completely confident in my c++ skills yet as im studying it, so maybe some would like to help me tackle by introducing me to the project structure and the working parts making up KDE.
Comment 24 imaginator 2022-10-02 13:32:10 UTC
(In reply to devsk from comment #22)
> (In reply to Bernie Innocenti from comment #21)
> > (In reply to devsk from comment #20)
> > > Or the devs you already have are interested only in next shiny thing than to
> > > fix bugs in their code...:-) Sure, we can't force devs to stick around
> > > forever and fix bugs in their code but sometimes, its good to stop new
> > > development and just fix the bugs. You will have more adoption and
> > > participation, and that can potentially get you more devs.
> > 
> > As a user, I also wish session restore to worked on Wayland, but
> > inflammatory comments won't help expedite it.
> 
> I swear inflammation was not the intention. But truth can be hard sometimes
> and it lands wrongly in written communications. My apologies if it sounded
> like that.
Your comment was not inflammatory at all. It was your opinion expressed in a friendly and factual manner. IMO.

But it seems to me that esp. in the FOSS community quite a few people simply can't stand critigue, however constructive or well intentioned or politely formulated it may be. They seem to experience critigue as an aggression and not as a chance for improvement. And I consider that a major weakness and an obstacle to success.
Comment 25 imaginator 2022-10-02 13:34:48 UTC
This "bug" or missing key feature, as I see it, is obviously really bad and at this point of time quite shocking. Two days ago I was about switching to Plasma-Wayland because I had such a favorable impression of it. Until I discovered this thing.

I don't know whether this situation is due to a lack of provision in the Wayland-design or an inability of developers to focus on what really matters. But if the Plasma devs could solve this on their own, I'd strongly suggest they drop any other Wayland related work *NOW* and start working like hell on resolving this issue.

Because this is so detrimental to Plasma's and KDE's reputation that they may not recover from it. IMO.
Comment 26 Nate Graham 2022-10-17 20:06:11 UTC
*** Bug 460567 has been marked as a duplicate of this bug. ***
Comment 27 Andreas Hartmann 2022-11-27 14:48:53 UTC
Same problem here with leap 15.4. Would be really nice to get it fixed ... .