Bug 89847

Summary: reopening from systray forces desktop switch if on other desktop
Product: [Unmaintained] kmail Reporter: Erik Charlebois <erikcharlebois>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: bjoern, jjm, samwise-gamgee
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Open kmail window on current desktop
Open kmail window on current desktop (exactly as KSystemTray does)

Description Erik Charlebois 2004-09-20 03:21:13 UTC
Version:           kmail 1.7 (using KDE KDE 3.3.0)
Installed from:    Compiled From Sources

After minimizing kmail to the systray, if I switch to another desktop and open kmail it forces a change to the desktop that kmail was minized on rather than opening on the current desktop.

Also, if kmail is open on desktop #1, and I'm working in desktop #3 and click the systray icon, I get switched to desktop #1.

This behavior is inconsistent with the other kde apps I've tried that use the systray (amarok, noatun, akregator, kopete, knowit, kwallet), where the app will get opened on the current desktop.
Comment 1 mail 2004-10-01 18:07:38 UTC
I agree with the first point and disagree on the second. 
For me there is a reason to have a window on a certain desktop, so I expect KDE to switch to this desktop. But if KMail is not on a certain desktop but only in the systray, the window shall open on the current desktop.

I think the other apps you mention are either in the panel or in the systray and not in both? So there would not be an inconsistency.

similar problems are being discussed on bug #74938.
Comment 2 jos poortvliet 2005-09-30 20:20:39 UTC
this behaviour is not broken with for example amarok and kopete, so i think this counts as a bug, and i love to see it fixed (just wanted to report it myself).

btw i agree with mail@puchalla-online above me, if it is open, we should switch to that desktop.
Comment 3 Niels 2005-10-04 20:29:18 UTC
I agree with Comment #1. Kmail 1.8.91 always switches to the desktop it was on last. It should open on the current desktop if it's only in the tray.
Comment 4 Aaron J. Seigo 2005-10-04 21:08:39 UTC
this change was actually made quite on purpose and has nothing to do with kmail but the system tray implementation in kdelibs/kdeui

the reason why the other apps you mentioned don't work that way is because they don't pass a proper parent window to the systray icon so it doesn't know where to take you.

of the list you mentioned amarok, noatun, akregator and knowit should be fixed with regard to how they use the systray, while  kopete and kwallet are proper the way they are. it has to do with a distinction between what is an application and what is a continual run "service"
Comment 5 Carlos Sanchis 2006-04-09 11:28:48 UTC
On porpose or not, the fact is that if it's only in the systray and not open anywhere you don't really expect it to insist in staying in a specific desktop but open in the one you're in. I think the current behaviour is not intuitive at all, don't you think?
Comment 6 Jakub Schmidtke 2006-06-20 15:16:28 UTC
I think that this is *really* annoying. I like to change desktops myself, and if I click any application in the tray I expect it to open on the current desktop. Could there, at least, be an option in KDE configuration to select which behaviour should be used?
Comment 7 Carsten Lohrke 2006-06-21 12:28:56 UTC
> this change was actually made quite on purpose

Depending on personal preference this behaviour can be wanted or quite irritating (as this bug shows). How about not changing the desktop, but making the app sticky, when openend from system tray, but having a different desktop than its parent desktop active (and unsticky, but keeping the old parent desktop, when minimizing to tray)? 


btw.: At the moment the stay on top, sticky, etc. flags get not restored, when an app gets reopend from tray. Is this considered a feature or a bug? (imho the latter).
Comment 8 Peter 2006-06-21 14:54:59 UTC
*** This bug has been confirmed by popular vote. ***
Comment 9 Stephan Sokolow 2006-08-04 09:13:25 UTC
My current workaround is to use Kontact and click the aKregator tray icon instead... but it is a pain to have to use a second click to switch Kontact to the KMail panel.
Comment 10 Dmitry Morozhnikov 2006-10-23 12:22:12 UTC
Good or bad, but current behavior is to keep kmail window on some specific desktop. Sure, it is pretty annoying to open kmail window from system tray, alt+tab and lost several seconds on trying to determine where you are in. So, i post this patch which add (not default) option to raise kmail on current desktop or switch to desktop where it is shown already. Like every other application, ktorrent for example.
Comment 11 Dmitry Morozhnikov 2006-10-23 12:25:15 UTC
Created attachment 18232 [details]
Open kmail window on current desktop

Patch for kdepim-3.5.5+ branch

Sync with revision 598285.
Comment 12 Dmitry Morozhnikov 2006-10-25 13:06:45 UTC
Created attachment 18258 [details]
Open kmail window on current desktop (exactly as KSystemTray does)

This patch exactly reimplemented KSystemTray::activateOrHide() behavior (mostly
with copy-paste), including raising of window if it is obscured by other
windows instead of hide.

Sync with revision 598989.
Comment 13 Jonathan Marten 2006-10-28 12:56:50 UTC
I like the current behaviour (switch to specific desktop when opened) and hate the behaviour of amarok (always reopen on current desktop).  Should we submit a wishlist to make this a global KDE-wide configuration option?  If it could be implemented in KSystemTray it would reduce duplicated code in some applications, and improve consistency...
Comment 14 Stephan Sokolow 2006-10-28 13:24:27 UTC
I like the idea of it becoming a global KSystemTray option.
Comment 15 Jonathan Marten 2006-10-28 16:46:26 UTC
KDE bugs day: see also 121673, not marking that because not an exact duplicate
Comment 16 Dmitry Morozhnikov 2006-11-02 04:49:41 UTC
This bug is exact duplicate of http://bugs.kde.org/show_bug.cgi?id=74938 . And 74938 also have patch to solve this problem.
Comment 17 Philip Rodrigues 2006-11-14 20:02:19 UTC
*** Bug 123532 has been marked as a duplicate of this bug. ***
Comment 18 Thomas McGuire 2007-08-30 18:37:47 UTC

*** This bug has been marked as a duplicate of 74938 ***
Comment 19 Björn Ruberg 2009-12-22 11:09:54 UTC

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