Bug 63480 - [PATCH] kmail system tray icon behaviour not standard
Summary: [PATCH] kmail system tray icon behaviour not standard
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 66874 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-08-30 19:09 UTC by Gav Wood
Modified: 2007-09-14 12:17 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch to fix tray icon behavior (5.17 KB, patch)
2004-04-16 02:36 UTC, Nathan Toone
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gav Wood 2003-08-30 19:09:37 UTC
Version:           1.5.9 (using KDE 3.1.9)
Compiler:          gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)
OS:          Linux (i686) release 2.4.20-gentoo-r5

the style guidelines suggest that an application that displays a system tray icon should not close simply by closing the main window; instead it should simple hide the mainwindow and stay running.

http://developer.kde.org/documentation/standards/kde/style/basics/systray.html
Comment 1 Stephan Kulow 2003-10-31 19:05:44 UTC
*** Bug 66874 has been marked as a duplicate of this bug. ***
Comment 2 Ingo Klöcker 2003-11-01 01:14:11 UTC
Subject: Re:  New: kmail system tray icon behaviour not standard

On Saturday 30 August 2003 19:09, Gav Wood wrote:
> the style guidelines suggest that an application that displays a
> system tray icon should not close simply by closing the main window;
> instead it should simple hide the mainwindow and stay running.

That's correct. But if the user chooses the "Show system tray on new 
mail" mode then KMail's behavior on clicking the X button will be 
inconsistent/confusing because if there are no unread messages (and 
therefore no systray icon) then KMail would be terminated and if there 
are unread messages (and therefore also the systray icon) then KMail 
would just be hidden. I don't know whether that's a desirable behavior.

If OTOH the user uses the "Always show system tray" mode then KMail 
should behave like the style guide says.

I cc'ed kde-usability for advice how to proceed in the "Show system tray 
on new mail" case. Please send all replies also to the bug report 
(63480@bugs.kde.org).

Regards,
Ingo
Comment 3 Nadeem Hasan 2003-11-01 04:22:32 UTC
Subject: Re:  New: kmail system tray icon behaviour not standard

Quoting Ingo Kl
Comment 4 Stephan Kulow 2003-12-05 11:15:56 UTC
*** Bug 69656 has been marked as a duplicate of this bug. ***
Comment 5 Jose Hernandez 2004-01-11 23:52:55 UTC
I favor minimizing to tray when close button is clicked and it has a system tray icon. If the user doesn't want it in the system tray, then closing exits. Sounds good to me.
Comment 6 Brad 2004-03-25 13:35:10 UTC
I agree. I was going to report this as a wish/bug until I found this one.  Being in the habit of clicking the close button in Thunderbird, the switch to Kontact is driving my wife crazy as she keeps exiting when she means to hide.  If someone really wants to quit, they can do so from the File menu.

Another, less desirable, option is to take the Windows approach of "dumb" users, and ask "Are you sure?" when the close button is clicked.  Then the user could say 'no' and remember to click the tray icon.
Comment 7 missive 2004-04-09 17:35:38 UTC
Also, when bringing the kmail window back up from the systray, the window is coming up on the virtual desktop where it previously was shown instead of the desktop that I am currently working on.

So, it drags me to the other desktop instead of just coming up.

Comment 8 Nathan Toone 2004-04-16 02:36:51 UTC
Created attachment 5656 [details]
Patch to fix tray icon behavior

This patch adds the functionality described above.  If the users does not use
tray notifications, then the close button exits the program.  If they use
notifications on new mail only, then when they click close, it shows the icon
and hides kmail.  If they always show the tray icon, then it just hides kmail
when they click on the close button.

This would be a valuable thing to add to CVS, if the patch is acceptable.
Comment 9 Mary Ellen Foster 2004-04-16 10:45:42 UTC
Regarding comment #7: I actually consider that behaviour a *feature*. I always keep kmail running on virtual desktop 1, and I like that I can click on the tray icon and be taken to where it's running; I don't want it to pop up on whatever desktop I happen to be working on when the mail comes in.

But this could just be me ...
Comment 10 Nathan Toone 2004-04-16 16:00:43 UTC
The patch I submitted addresses the original issue (regarding clicking on the "close" button...)

It seems to me that comment #7 would better be addressed by being logged as a separate bug (it *IS* a separate issue...)
Comment 11 cerebro84 2004-04-16 18:51:01 UTC
> Patch to fix tray icon behavior
It does work for me and it's ok. Thank you!

Comment 12 Trevor Feeney 2004-04-18 07:03:03 UTC
I was just trying to figure out whole the tray thing worked as well.  And it's not like I'm a newbie or anything either.  It just didn't make sense to me that to minimize to tray, I had to click the tray.  All other KDE apps you click close to go to try.  It should certainly follow the standards.
Comment 13 Nathan Toone 2004-04-19 20:41:45 UTC
has anyone had a chance to review the patch and see if it can be committed?
Comment 14 Jason Keirstead 2004-05-28 02:27:15 UTC
Flagging patch so KMail devs will notice it
Comment 15 Nathan Toone 2004-05-28 04:49:35 UTC
Actually I'm working on a new version of the patch that works with KMail and Kontact both.  (My first patch only worked with KMail)
Comment 16 miro 2004-08-09 18:39:30 UTC
Well just to make it even better:

I use the new "WindowMenu->Advanced->Special window settings" dialog to make kmail not appear on the taskbar.
But now the minimize button does not work. I know that this is propably not a Kmail problem. There is normally also "nowhere" to minimize the window to when activated, but in this case it can go to the systray... so when configured to always show in the systray don't let it on the taskbar


[It would be ok with me if a window with no taskbar entry would be minimized to nowhere as it is still accessible via alt+tab...]
Comment 17 Christoph Wiesen 2004-08-17 14:33:51 UTC
Has this patch been included in the current KDE 3.3 ? I am using 3.3 via the Debian unstable packages right now but afaik Kmail is not yet updated so I can't see.

Right now I wanted to report this (minimize to tray when pressing X, at least when "always show systray icon" is enabled) as a bug right now - hope it has been fixed though.
Comment 18 Nathan Toone 2004-08-17 16:50:36 UTC
It works in the latest CVS, and it has since the beginning of June.  I don't know if it was included in 3.3 though...

It should be easy enough to backport, though.
Comment 19 Tels 2004-08-29 11:23:06 UTC
"I favor minimizing to tray when close button is clicked and it has a system tray icon. If the user doesn't want it in the system tray, then closing exits. Sounds good to me."

I don't like that at all. I like my windows to close when I click [X], not to put them into the systray. I like it when kmail shows new email there, but closing the main windows is synonymous with exiting the program - and it should stay so. The styleguide seems wrong to me (especially because 90% of all programs exit, but a few don't - that's inconsistent. The program should go to the systray if I _minimize_ it, not if I close it)
Comment 20 Gav Wood 2004-08-29 12:43:24 UTC
> "I favor minimizing to tray when close button is clicked and it has
> a system tray icon. If the user doesn't want it in the system tray, then
> closing exits. Sounds good to me."

what people favour isn't really the point; the style guidelines are there for 
a reason, and this should stay as a bug until either:

a patch is committed that fixes the tray behaviour.
or
the style guidelines are changed.

> The program should go to the systray if I _minimize_ it, not if I close it)

this, imo is an incorrect assumption (probably spread by windows' completely 
chaotic systray bahaviour).

here's 2 quick rules to set out what (imho) the *kde* style guidelines are 
trying to get accross to the user/dev:

1. if an application has a tray icon, it "lives" there; a window closing 
should therefore never exit the app.
2. *applications* cannot be *minimised* wholesale; "minimisation" is a 
*window*-level operation.

bish bosh,

gav

Comment 21 Nathan Toone 2004-08-29 16:22:35 UTC
I know it's been fixed in the latest CVS (becuase I fixed it...)  I don't know if it was included in 3.3 (I had thought it had...)

I just verified, and this is how it works (I'm running the latest CVS version - again, I don't know if it's been included into 3.3 - but I'm pretty sure that it has.

If there is no tray icon notifications -->  Close on clicking "X"
If there are ALWAYS tray icon notifications --> Minimize to tray on clicking "X"

Those both follow the style guide.  The final option was kind of "made up" because there isn't really a defined way that it should work:

If there are tray notifications ON NEW MAIL ONLY -->  If the icon is not shown, show it and minimize to tray.

Again, there aren't really guidelines for the last case - it was decided to use this behaviour based on postings the the mailing lists, comments on this bug, and discussions on #kontact.  (This bug was fixed as a part of fixing the same issue within Kontact.

If it's not working that way in current CVS, then I'd be interested in knowing about it... :)  (If it is, then this bug should be closed.)
Comment 22 Gav Wood 2004-08-29 16:35:47 UTC
*** Bug has been marked as fixed ***.
Comment 23 Christoph Wiesen 2004-08-29 16:57:50 UTC
Just to let everyone know - the behaviour as described above for CVS is exactly the same in the KDE 3.3 Final (using Debian unstable builds myself).

I think first and second options are exactly as described in the guidelines (and make a lot of sense too), so I think they don't need to be discussed. Personally i think the third option (only systray when new mail) is resolved very well, too.
This way the "enable systray icon" option decides if "X" closes the window or quits the application.
This the guidelines are followed here to - KMail *has* a systray when the option is enabled, it's just not visible when no new mail is present.

-> Everybody happy / spending my votes on other bugs :)