<AWT Dev> 8252015: Enhancement TrayIcon for macOS 11.0
Tres Finocchiaro
tres.finocchiaro at gmail.com
Tue Sep 1 16:23:10 UTC 2020
Hi,
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.
https://bugs.openjdk.java.net/browse/JDK-8252015
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:
https://github.com/qt/qtbase/blob/471e4fcb226c4523efe93b1bdaf0db026495da94/src/gui/image/qicon.cpp#L1341-L1355
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:
TrayIcon.isTemplate()
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
accepted?
Cordially,
-Tres
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