Bug 188866 - Make clicking on system tray icon more consistent with taskbar
Summary: Make clicking on system tray icon more consistent with taskbar
Status: REPORTED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeui (show other bugs)
Version: 4.2.2
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-05 11:02 UTC by matsei
Modified: 2009-04-13 16:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Change behavior when app is shown not minimized on other desktop (1.67 KB, patch)
2009-04-05 11:03 UTC, matsei
Details
Same patch without the typo (1.67 KB, patch)
2009-04-05 11:07 UTC, matsei
Details
Same patch with fix for windows shown on all desktops (1.68 KB, patch)
2009-04-05 12:55 UTC, matsei
Details
New version of the patch (1.75 KB, patch)
2009-04-05 14:44 UTC, matsei
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matsei 2009-04-05 11:02:07 UTC
Version:           4.2.2 (using KDE 4.2.2)
Compiler:          gcc version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5)
 
OS:                Linux
Installed from:    Gentoo Packages

Hello,

Right now on kde-4.2.2 a dummy application that uses plain KSystemTrayIcon has the following behavior:
- app show on current desktop, not obscured
  - click on taskbar entry => minimize to taskbar
  - click on system tray => minimize to tray
- app on current desktop, obscured
  - click on taskbar entry => raise, focus
  - click on system tray => raise, focus
- app hidden in systray, not showing or minimized anywhere
  - click on systray => show, raise, focus on current desktop
- app shown on other desktop, minimized:
  - click on taskbar entry => move user to app's desktop
  - click on systray => move user to app's desktop
All this is fine and consistent

But:
- app shown on other desktop, NOT minimized:
  - click on taskbar entry => move to app's desktop, un-minimize raise focus
  - click on systray => hide app in systray

This last behavior is a bit surprising and is the only inconsistency I can find between taskbar and systray handling (appart from the very first point which is obviously what is expected).

Browsing the bugs for systray, there appears to be some demand for having this behavior more consistent, i.e. if the window is shown on another desktop and the user clicks on its systray, move to that desktop (raise/focus as necessary).

I'll attach a patch for kdelibs/kdeui/util/ksystemtrayicon that should do exactly that.

Would this be acceptable?

Apps that already override systray behavior by not giving a parent widget should be entirely unaffected if I'm not mistaken.

Thanks for reading!
Mat
Comment 1 matsei 2009-04-05 11:03:20 UTC
Created attachment 32613 [details]
Change behavior when app is shown not minimized on other desktop
Comment 2 matsei 2009-04-05 11:07:45 UTC
Created attachment 32614 [details]
Same patch without the typo

Sorry, wrong patch attached first time, didn't even build ...
This is agains kdelibs-4.2.2 release tarball.
Comment 3 matsei 2009-04-05 12:55:34 UTC
Created attachment 32617 [details]
Same patch with fix for windows shown on all desktops

Previous patch used the cached d->onAllDesktops information to guard against these types of apps, but that was not appropriate.
Comment 4 matsei 2009-04-05 14:44:07 UTC
Created attachment 32620 [details]
New version of the patch

Fix an additional bug with the following sequence:
- start a trayable app
- set "On All Desktops"
- hide to tray by clicking on tray applet
- show app by clicking on tray applet
=> d->onAllDesktops = true, app is visible
- set e.g., "On Desktop 1"
- minimize to taskbar (not to tray)
- click on tray applet
=> mapped == false because info.isMinimized() is true
=> d->onAllDesktops is still == true, nothing has updated that yet
=> minimizeRestore(true) will restore to all desktops...

Fix this by refreshing d->onAllDesktops if window is minimized before doing the restore.
Comment 5 matsei 2009-04-13 16:15:21 UTC
Updated patch available at http://reviewboard.kde.org/r/579/