<AWT Dev> 8252015: Enhancement TrayIcon for macOS 11.0

Tres Finocchiaro tres.finocchiaro at gmail.com
Tue Sep 1 16:23:10 UTC 2020


Recent changes to macOS theming make it impossible to theme a TrayIcon in
accordance with Apple's Human Interface Guidelines starting with macOS 11.0
"Big Sur" which is now available for public beta.


In order to make the UI work properly with this OS, some API calls need to
be changed and the API needs to change.

Specifically, a new boolean flag influencing NSImage::isTemplate is
required, a change to the awt SystemTray/TrayIcon API.  This is explained
lower however in order to allow ::isTemplate to be called, the underlying
NSImage handling needs to change a bit first.

My programmer has a proof of concept available which performs both changes
mentioned however the NSImage::isTemplate flag must be provided through an
AWT API, requiring a permanent change to the TrayIcon API for AWT to handle
the templating of icons.

Note, the Qt framework has a near identical API for this exact purpose:

In our proof of concept, we're doing the following:

TrayIcon.setTemplate(boolean) -->
    TrayIconPeer.setTemplate(boolean)  -->
    CXTrayIcon.setTemplate(boolean)  -->
    CXTrayIcon.nativeSetTemplate(long, boolean)

.. and to retrieve the value:


My questions to the AWT team are as follows:

   - Are such API changes allowed in AWT to improve the user experience?
   - If so, will they be accepted if these functions have not yet been
   ported to other platforms (such as Win32, GNU Linux, etc)
   - What will be our next steps as to work with AWT on getting this change



P.S. We've signed the Oracle OCA under "QZ Industries LLC".

- Tres.Finocchiaro at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/awt-dev/attachments/20200901/32bd3324/attachment.htm>

More information about the awt-dev mailing list