Bug 75673

Summary: [PATCH] bad session management when KMail is minimized to tray
Product: [Unmaintained] kmail Reporter: Olivier Fisette <olivier.fisette>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aliakc, jlp, khanreaper, winter
Priority: NOR Keywords: triaged
Version: 1.10.90   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Make kmail start hidden if restored by session manager
Restore kmail hidden at session startup if it was hidden
Simpler version of the previous patch

Description Olivier Fisette 2004-02-20 03:39:23 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Gentoo Packages
OS:          Linux

When I close a KDE session while KMail is minimised to tray, KMail is not started when opening a new session. From time to time, session management tries to restore KMail but fails : it incorectly reports there is already an instance of KMail running. I then have to manually remove the lockfile to be able to execute KMail. I would expect the tray icon to be restored between sessions.
Comment 1 Joerg de la Haye 2004-04-22 18:37:15 UTC
Similar problem for me, user defined save session used by ksmserver doesn't work if kmail is minimized to tray. It does work if you save the session when kmail is not minimized, then it is restored as it should.

I can't confirm the lockfile issue for my installation (Debian unstable, KDE 3.2.2, kmail 1.6.2).
Comment 2 Tom Albers 2004-09-07 16:22:28 UTC
Could you check with kde 3.3 ? I can not reproduce this anymore. I'll close this report for now, please reopen if it still happens.
Comment 3 Joerg de la Haye 2004-09-07 17:36:18 UTC
It does work now, partly. The session is restored, including kmail, but kmail is started maximized, even if it was minimized during session saving.

So the bug reports' title should change from "No or bad session management when KMail is minimized to tray" to "bad session management when KMail is minimized to tray".

So maybe you should reopen it (I can't, as I'm not the reporter).
Comment 4 Tom Albers 2004-09-07 17:49:02 UTC
as requested
Comment 5 Tom Albers 2004-10-08 18:30:59 UTC
*** Bug 90919 has been marked as a duplicate of this bug. ***
Comment 6 Łukasz Jernaś 2005-04-12 19:39:53 UTC
*** This bug has been confirmed by popular vote. ***
Comment 7 Matt T. Proud 2005-08-25 17:00:30 UTC
I can confirm that this still happens with KDE 3.4.1.
Comment 8 Michael Stather 2005-09-04 17:58:10 UTC
This also happens with KDE 3.4.2
Any possibility that this will be fixed?
Comment 9 Christian D. 2006-02-09 21:35:12 UTC
KDE 3.5.1 and still not fixed!!
Comment 10 Jan 2006-11-21 19:09:07 UTC
KOrganizer tray module is exactly what I want.
Click on the tray item -> one can choose wheather you want to start it on startup or not. If selected it starts minimized to the tray.
Comment 11 Aaron Randall 2007-10-24 17:37:08 UTC
Hi,

I am also having problems with this feature.  KMail is refusing to start minimised to the tray.  At the moment I have implemented it by changing the KMail icon to run the following command:

"kmail;dcop kmail kmail-mainwindow#1 hide"

This runs KMail, and then sends a message via DCOP to hide the main window to the system tray.

I hope this helps until this feature is implemented properly :)

Regards,

Aaron
Comment 12 Jure Repinc 2008-11-09 22:15:23 UTC
I've checked this with KMail from KDE SVN r881890 (to be in KDE 4.2) and KMail doesn't start minimized to tray, it's maximized.
Comment 13 matsei 2009-03-07 16:39:56 UTC
Created attachment 31876 [details]
Make kmail start hidden if restored by session manager
Comment 14 Thomas McGuire 2009-03-08 19:54:04 UTC
> Make kmail start hidden if restored by session manager

Well, if I had KMail maximized before shutdown, I still want to have it maximized when the session is restored. That is not handled by the patch, right?

Can you add that to the patch? Either remember the shown/hidden state in KMail or in KMainWin (probably needs a new restore() method for compatibilty then).

If the patch is ready, please submit it to reviewboard.kde.org, under the "kdepim" group.

Thanks.
Comment 15 matsei 2009-04-02 18:24:09 UTC
Created attachment 32542 [details]
Restore kmail hidden at session startup if it was hidden

Indeed kmail never got restored with the previous patch.
This one should do the trick with a ->restore override and
session state save/restore copied and adapted from aKregator.
Comment 16 Allen Winter 2009-04-02 18:38:01 UTC
Appreciate it if you would post this to our new patch review system on reviewboard.kde.org under the kdepim group.

This is where we now collect and review patches.
Comment 17 matsei 2009-04-03 08:45:21 UTC
Created attachment 32554 [details]
Simpler version of the previous patch

Simpler version attached, reviewboard thingy at:
http://reviewboard.kde.org/r/504/
Should I try and keep bgo in sync with reviewboard if this goes anywhere?
I'm not sure I understand the process/workflow.
Comment 18 Allen Winter 2009-04-03 14:16:35 UTC
> Should I try and keep bgo in sync with reviewboard if this goes anywhere?
> I'm not sure I understand the process/workflow.

No need.
The workflow will continue on reviewboard.
Comment 19 Thomas McGuire 2009-04-08 19:48:48 UTC
SVN commit 951220 by tmcguire:

Remember the docked state for session management.
Patch by Mathieu Seigneurin <matsei@seimat.net>, thanks!

BUG: 75673


 M  +19 -0     kmmainwin.cpp  
 M  +9 -0      kmmainwin.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=951220
Comment 20 Thomas McGuire 2009-04-14 10:02:53 UTC
SVN commit 953503 by tmcguire:

Backport r951220 by tmcguire from trunk to the 4.2 branch:

Remember the docked state for session management.
Patch by Mathieu Seigneurin <matsei@seimat.net>, thanks!

CCBUG: 75673



 M  +19 -0     kmmainwin.cpp  
 M  +9 -0      kmmainwin.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=953503