JDK-6550590 : Systray support detection in XToolkit is too simplistic, fails with compiz
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2007-04-26
  • Updated: 2011-02-16
  • Resolved: 2007-09-05
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
Pulled from sources at jdk-6u2-ea-src-b02-jrl-12_apr_2007.jar

ADDITIONAL OS VERSION INFORMATION :
Linux bishop 2.6.16.37-0.20-default #1 Wed Feb 14 03:50:25 UTC 2007 i686 i686 i386 GNU/Linux

Applies to all linux machines

EXTRA RELEVANT SYSTEM CONFIGURATION :
GNOME 2.x and KDE 3.x

A DESCRIPTION OF THE PROBLEM :
In XToolkit.java, systray support is determined by the following function:

    public boolean isTraySupported() {
        int wm = XWM.getWMID();
        if (wm == XWM.METACITY_WM || wm == XWM.KDE2_WM)
        {
            return true;
        }
        return false;
    }

so it is hardcoding the window manager.

Trivial fix is straightforward of course, just add compiz to the list of wmids.

The real fix though needs more complexity, checking for metacity isn't strictly correct, gnome-panel needs to be running, and in the case of KDE kwin isn't enough, kicker needs to be running as well.  xfce probably has a systray implementation as well that should be covered.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
call SystemTray.isSupported() in a GNOME or KDE system running compiz.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
returns true
ACTUAL -
returns false

REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION In our code we have already gor a right check for the system tray availability: get the value of _NET_SYSTEM_TRAY_S0 atom. See XSystemTrayPeer.addTrayIcon() method. Probably, the same approach may be used in the isSupported() method.
27-04-2007