Bug 206511

Summary: application launcher recent list is not saved if session is not saved
Product: [Unmaintained] plasma4 Reporter: Andriy Gapon <avg>
Component: widget-kickoffAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: annma, asraniel, giorgos.tsiapaliokas, kde, mgraesslin
Priority: NOR    
Version: 4.8.3   
Target Milestone: ---   
Platform: FreeBSD Ports   
OS: FreeBSD   
Latest Commit: Version Fixed In: 4.8.5
Sentry Crash Report:

Description Andriy Gapon 2009-09-06 17:11:49 UTC
Version:            (using KDE 4.3.1)
OS:                FreeBSD
Installed from:    FreeBSD Ports

It seems that saving of Recently Used Applications list (in Application Launcher) is tied to session saving.
That is, if a session is not saved then this list gets reset to previous state after Logout+Login.

I think the this is a bug because in KDE3 the list was saved regardless of session saving. And I think that that list is not a part of a session state in logical sense.

Some additional explanation. I configured my KDE to save sessions manually. I want this because when I log in I want to get a proper starting session state, not a state that happened to be there when I last logged off. I.e. I want certain applications started on certain desktops etc. I save a good session state once and then almost never update it. But now some information gets lost. 

BTW, it seems that if KDE/plasma crashes then updates to this list get lost too.
Comment 1 Nicolas L. 2010-06-07 11:06:21 UTC
i don't reproduce here 
Do you reproduce with kde 4.4.4 or 4.5 beta ?
Comment 2 Anne-Marie Mahfouf 2010-06-07 14:14:22 UTC
Works fine on trunk (next 4.5) whatever the session management is set to.
ALso works on 4.4 branch for me.


I remember a bug report for 4.3 for this problem though. Bus as far as I could test, it's now fixed!
Comment 3 Nicolas L. 2010-06-07 14:22:30 UTC
please reopen if this bug reappear for you
Comment 4 Andriy Gapon 2010-06-08 13:59:46 UTC
It seems that the list is saved now during graceful logout.
If X session or a machine crashes for whatever reason, then all updates to the list during the last session seem to get lost still.
Comment 5 Anne-Marie Mahfouf 2010-06-08 14:18:57 UTC
It seems I was wrong in fact. The Recently Used Applications appear as soon as I run a new one from Kickoff but then this list is lost when I restart plasma. 
The Recently Used Documents is correctly saved and restored though.
Comment 6 Giorgos Tsiapaliokas 2011-01-11 11:35:19 UTC
i cannot reproduce the bug.

my box's specifications are,


Qt: 4.7.1
KDE Development Platform: 4.6.40 (4.7 >= 20101222)
os:gentoo ~amd64
Comment 7 Martin Flöser 2011-12-08 20:46:38 UTC
Is this still an issue with a recent version, e.g. 4.7.4?
Comment 8 Andriy Gapon 2011-12-13 18:09:49 UTC
Personally for me this is still an issue.  Or a variation of the issue.  Or a different, but closely related issue. The behavior is actually unpredictable in part.

First, if a KDE session is ungracefully interrupted for some reason (e.g. system crash, X server crash, Crtl-Alt-Backspace), the the list definitely doesn't keep a history from the session.
Second, if I do a graceful logout, then sometimes the list is up to date on the next login and sometime it goes back in time (i.e. seems to be unsaved).
Comment 9 Myriam Schweingruber 2012-05-16 09:41:12 UTC
Last reported with 4.7.4, is this still valid with KDE 4.8.3 or later?
Comment 10 Andriy Gapon 2012-05-26 09:49:05 UTC
Using 4.8.3 I can confirm the part that the Recently Used Applications list is not saved if KDE session is terminated ungracefully (e.g. X crash).  Looks like the list saving is still tied to some exit/logout hooks.
I think that the list should be saved instantaneously after it changes (an application is launched via menu).

I still need to check the behavior when KDE is configured to "Restore manually saved session" on login.
Comment 11 Myriam Schweingruber 2012-05-26 13:39:36 UTC
Thank you for the fast feedback.
Comment 12 Andriy Gapon 2012-05-28 20:12:02 UTC
I've just experienced (with 4.8.3) another side of this bug.  I gracefully logged out, then logged in, but the recent apps list didn't look like what it was right before the logout.  Instead it looked like what it was before the previous logout.
This sub-problem looks non-deterministic (unlike what I reported in comment #10), probably because of some races in the session exit code path which seems to be a mix of async and sync actions.
Comment 13 Raphael Kubo da Costa 2012-07-25 17:40:50 UTC
Git commit b1439fb1901deee8f5442a5ae249e551a336b7cf by Raphael Kubo da Costa.
Committed on 25/07/2012 at 19:28.
Pushed by rkcosta into branch 'KDE/4.8'.

Fix callback race in the session save and shutdown code.

Quoting the review request:
  This patch tries to a fix a race in the session saving and shutdown
  code of ksmserver.

  The race may happen on wmPhase1WaitingCount variable when WM-type
  clients are fast enough to complete their save requests while the
  loop in KSMServer::shutdown is still iterating.  As a result
  wmPhase1WaitingCount may become zero too early and that would kick
  off the next save/shutdown phase in a client's callback.  In fact,
  it might even go multiple times from zero to non-zero and back
  during the WM-specific loop.

Patch by Andriy Gapon <avg@FreeBSD.org>

REVIEW: 105111
FIXED-IN: 4.8.5
CCMAIL: avg@FreeBSD.org

M  +15   -10   ksmserver/shutdown.cpp

http://commits.kde.org/kde-workspace/b1439fb1901deee8f5442a5ae249e551a336b7cf
Comment 14 Raphael Kubo da Costa 2012-07-25 17:55:11 UTC
Git commit 3af3f4c9c5bef5a3297ab50bcd445063b7441680 by Raphael Kubo da Costa.
Committed on 25/07/2012 at 19:28.
Pushed by rkcosta into branch 'KDE/4.9'.

Fix callback race in the session save and shutdown code.

Quoting the review request:
  This patch tries to a fix a race in the session saving and shutdown
  code of ksmserver.

  The race may happen on wmPhase1WaitingCount variable when WM-type
  clients are fast enough to complete their save requests while the
  loop in KSMServer::shutdown is still iterating.  As a result
  wmPhase1WaitingCount may become zero too early and that would kick
  off the next save/shutdown phase in a client's callback.  In fact,
  it might even go multiple times from zero to non-zero and back
  during the WM-specific loop.

I was planning on merging the KDE/4.8 branch into KDE/4.9, but there
were too many conflicts and I am not very familiar with this module,
so I'm cherry-picking this time. Merging KDE/4.9 into master is much
easier, though.

Patch by Andriy Gapon <avg@FreeBSD.org>

REVIEW: 105111
FIXED-IN: 4.8.5
CCMAIL: avg@FreeBSD.org
(cherry picked from commit b1439fb1901deee8f5442a5ae249e551a336b7cf)

M  +15   -10   ksmserver/shutdown.cpp

http://commits.kde.org/kde-workspace/3af3f4c9c5bef5a3297ab50bcd445063b7441680