[KDE/Mac] Review Request 126369: [OS X] adaptation(s) to platform limitations (WIP)
René J.V. Bertin
rjvbertin at gmail.com
Sat Dec 19 09:54:39 UTC 2015
> On Dec. 18, 2015, 11:07 p.m., Martin Klapetek wrote:
> > > is it to be expected (in kstatusnotifieritemtest.cpp) that tray->iconPixmap() returns a null QIcon immediately after calling tray->setIconByName()
> >
> > I believe so, it's "either-or", either you set the icon by name or
> > you set it by pixmap. If you set it by name, you don't really need
> > to call the iconPixmap I think because you can easily do that on any
> > local QIcon.
> >
> > This is also somewhat supported by the spec at [1].
> >
> > > how exactly is the NeedsAttention mechanism supposed to work?
> >
> > This is fully up to the host system iirc. Plasma5 does not swap the
> > icons anymore, there is a whole different effect which just zoomes
> > the normal icon. In other words, the needsAttention icon is not used
> > at all. OS X should adopt whichever mechanism is most "home" to it.
> >
> >
> > [1] http://www.notmart.org/misc/statusnotifieritem/statusnotifieritem.html
> I believe so, it's "either-or", either you set the icon by name or
you set it by pixmap
Of course; what I meant was that I tried to use the result of the icon lookup to set the application icon on OS X, by getting that result from tray->iconPixmap(). Apparently the actual lookup is delayed until some time after calling setIconByName(). Not really important.
> In other words, the needsAttention icon is not used
at all.
Not on the platforms you are familiar with, apparently. On OS X it turns out that it *is* used; it is the icon showing up in the "systray" when setting the NeedsAttention mode.
I think we have two basic choices regarding that icon and mode:
- either we want the icon to indicate that attention is requested; in that case we either badge the current "normal" icon or we agree on a different icon to be looked up from the theme. We may want to account for the possibility that there is no theme installed though, or that theme lookup will fail. I'm not sure if standalone app bundle builds like Christoph Cullman has been making for Kate contain a theme, and either way it appears that KDE_SESSION_VERSION needs to be set in the environment because if I do not set that variable I'm not getting icons in most places.
- We use another attention-getting mechanism exclusively, and in that case the code that changes the systray icon should probably be deactivated on OS X (or we should ensure that the attentionIcon is equal to the normal icon).
To be clear: I can only test the native bouncing Dock icon mechanism when I know how to introduce the required ObjC code (subclassing the private class, or a dedicated small ObjC++ file). And this mechanism will do nothing by design if the application doesn't have a Dock icon.
- René J.V.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126369/#review89724
-----------------------------------------------------------
On Dec. 17, 2015, 5:26 p.m., René J.V. Bertin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126369/
> -----------------------------------------------------------
>
> (Updated Dec. 17, 2015, 5:26 p.m.)
>
>
> Review request for KDE Software on Mac OS X and KDE Frameworks.
>
>
> Repository: knotifications
>
>
> Description
> -------
>
> 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
> -----
>
> CMakeLists.txt 6d09051
> src/CMakeLists.txt 7eb3125
> src/kstatusnotifieritem.cpp f9bf460
> tests/kstatusnotifieritemtest.cpp 973fc85
>
> Diff: https://git.reviewboard.kde.org/r/126369/diff/
>
>
> Testing
> -------
>
> 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.
> https://git.reviewboard.kde.org/media/uploaded/files/2015/12/16/286037ae-07b3-454a-a226-1748854493a1__kstatusnotifieritemtest-systray.png
> The systray icon and menu created by the KDE4 kwalletmanager (code has an equivalent patch)
> https://git.reviewboard.kde.org/media/uploaded/files/2015/12/16/4fc9d4e4-1537-478c-9196-94cbc17b6b7c__kwalletmanager-systray.png
> An Apple systray icon+menu that shows icons (which cannot be hidden)
> https://git.reviewboard.kde.org/media/uploaded/files/2015/12/16/fc48a963-2e18-4396-bd38-062d41688118__Apple-systray-menu-with-icons.png
> kstatusnotifieritemtest with added appIcon
> https://git.reviewboard.kde.org/media/uploaded/files/2015/12/17/e896e90d-f0a8-43f7-9199-847572832df7__kstatusnotifieritemtest-with-appIcon.png
> kstatusnotifieritemtest-with-appIcon+attention.png
> https://git.reviewboard.kde.org/media/uploaded/files/2015/12/17/f41081db-8e09-4ea2-95c1-f507c62109d4__kstatusnotifieritemtest-with-appIconattention.png
>
>
> Thanks,
>
> René J.V. Bertin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-mac/attachments/20151219/684c3013/attachment.html>
More information about the kde-mac
mailing list