United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6453521 TrayIcon should support transparency
JDK-6453521 : TrayIcon should support transparency

Details
Type:
Enhancement
Submit Date:
2006-07-27
Status:
Open
Updated Date:
2013-09-19
Project Name:
JDK
Resolved Date:
Component:
client-libs
OS:
linux
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Unresolved
Affected Versions:
6,7,8
Targeted Versions:
9

Related Reports
Relates:

Sub Tasks

Description
A DESCRIPTION OF THE REQUEST :
TrayIcon gets a grey background instead of a transparent one. We have reproduced this on Gnome (2.14.2) and KDE3.

JUSTIFICATION :
TrayIcon supports transparency on Windows (at least on XP)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Transparent background of TrayIcon on all platforms / windowing systems

                                    

Comments
EVALUATION

AWT TrayIcon API allows to set an animated image to tray icons. Every frame of animation is drawn over the previous one, this is implemented by clearing the whole rect of icon and drawing the new frame after this, otherwise we get a wrong image as described in 6267936. The color for clearing is obtained with getBackground(), so a grey rect appears. For details see the code for XTrayIconPeer.IconCanvas.paint() at XTrayIconPeer.java:517:

    gr.setColor(getBackground());
    gr.fillRect(0, 0, curW, curH);      <-- here the grey rect appears
    gr.drawImage(image, 0, 0, curW, curH, observer);
    gr.dispose();

I'm not sure if we can query KDE or GNOME about underlying panel color. Furthermore, that panel may have an arbitrary background image, so the best way to fix this bug is to query KDE or GNOME to repaint the panel below the tray icon, but I'm not sure if such API is available to AWT.
                                     
2006-07-28
Developers want this bug to be fixed.
"The number of votes at bugs.sun.com is 124(!)"
                                     
2013-09-19
This is not a bug, but Enhancement.
The vote rate is high due to bug age (from July 2006)!

Definitely a feature for jdk9.
We passed FeatureComplete for jdk8
                                     
2013-09-19
jdk8: SQE ok to defer!
                                     
2013-09-19



Hardware and Software, Engineered to Work Together