[KDE/Mac] Review Request 126369: [OS X] adaptation(s) to platform limitations (WIP)

René J.V. Bertin rjvbertin at gmail.com
Thu Dec 17 16:26:00 UTC 2015

This is an automatically generated e-mail. To reply, visit:

(Updated Dec. 17, 2015, 5:26 p.m.)

Review request for KDE Software on Mac OS X and KDE Frameworks.


I've been working on this some more.

In addition to badging the systray icon with a NeedsAttention label, I've also
- worked around the absence of tool tip subtitles
- worked around notification messages getting lost. Since OS X 10.8, QSystemTrayIcon::showMessage() hooks into the native notification centre, which behaves a lot like how notifications work on a Linux/KDE(4) desktop. On earlier OS X versions Growl is used directly.
Messages relayed through the DBus get lost. Is that because Growl is supposed to handle them, and I don't have that utility installed? If so, I'd suggest dropping the indirection through DBus, on OS X.

Repository: knotifications


OS X has a number of limitations in features used by KNotifications, notably concerning the status notifier item (aka system tray icon).

This RR will likely evolve to address multiple limitations (at least also the NeedsAttention state); at the moment it only proposes an emulation of `QMenu::addSection`.

`QMenu::addSection` works by adding a QAction with a "texted separator" at the insertion location. Texted separators do not exist in menu items in the OS X "global" menubar (they become regular separators), and Qt will not provide a platform-specific implementation. Loss of the section title text is maybe not always an issue, but I think it is in the system tray menu. I therefore propose to emulate `QMenu::addSection` by replacing the texted separator with an inactive (disabled) menu item that shows the text, followed by a standard separator. Menus in the notification area are much less subject to interface guidelines, so the presence of an item icon is acceptable and IMO useful for the `titleAction`.

Testing the NeedsAttention state with the tests/kstatusnotifieritemtest application leads to disappearance of the menubar icon, i.e. the access to the notifier menu becomes invisible rather than blinking (which is what I get on Linux using the same packaging). Adding a few qDebug statements shows that the `attentionIcon` is empty.
I'd appreciate a crash course how this feature is supposed to work, so I can see if an OS X implementation might be feasible.

Diffs (updated)

  CMakeLists.txt 6d09051 
  src/CMakeLists.txt 7eb3125 
  src/kstatusnotifieritem.cpp f9bf460 
  tests/kstatusnotifieritemtest.cpp 973fc85 

Diff: https://git.reviewboard.kde.org/r/126369/diff/


On OS X 10.9.5 with Qt 5.5.1 and frameworks 5.17.0 .

File Attachments

the systray icon & menu created by kstatusnotifieritemtest . This application has no icon to show.
The systray icon and menu created by the KDE4 kwalletmanager (code has an equivalent patch)
An Apple systray icon+menu that shows icons (which cannot be hidden)
kstatusnotifieritemtest with added appIcon


René J.V. Bertin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-mac/attachments/20151217/e641a259/attachment.html>

More information about the kde-mac mailing list