Created attachment 463840 [details] test program Description of problem: The best way to see the problem is using the attached test program in conjunction with Compiz. First, resize the window so that the popup menu is taller than the window. You will see that the popup gets a correctly rendered drop shadow. (This appears to be because it's a real, heavyweight component due to the fact that it extends outside of the parent window.) Then make the window tall enough so that the popup menu fits entirely inside it, and bring up the menu again. This time, you'll see no drop shadow, presumably because in this case, it's a Swing component instead of a real component. This looks really stupid. Note that adding JPopupMenu.setDefaultLightWeightPopupEnabled(false), which you'd think would solve the problem, appears to have no effect here. So, it appears that the JVM needs to detect whether a compositing window manager is running, and if so, always use heavyweight popups. Version-Release number of selected component (if applicable): java-1.6.0-openjdk-1.6.0.0-44.1.9.1.fc14.x86_64 How reproducible: Always. Steps to Reproduce: 1. See description above. Actual results: Popup menus should get drop shadows. Expected results: Popup menus get no drop shadows.
NB: The bug I'm reporting isn't the same as the one noted in the URL above---that Sun bug is specifically about the GTK LaF, while the bug I'm reporting seems to be LaF-independent.
Looks like JPopupMenu.setDefaultLightWeightPopupEnabled(false) makes the popup mediumweight, not heavy weight. We will have to patch JPopupMenu to make it heavyweight.
This is not only a problem with Compiz, I see now that I've tried GNOME 3---it happens with any compositing window manager, and still happens in F15.
This remains a problem with java-1.6.0-openjdk-1.6.0.0-65.1.11.1.fc16.x86_64 in Fedora 16.
Re-assigned to Mario -- Mario, can you please take a look when possible?
The bug 6800513 in the Sun bug database is really the same as this one (although the bug has been submitted specifically for the GTK laf). As Omair correctly stated the problem is that the popup are made MEDIUM_WEIGHT rather tan HEAVY_WEIGHT, while the HW components are only used when the popup goes over the available space in the containing frame. A fix for OpenJDK8 is under discussion on the AWT mailing list, but I don't know yet if we will push for OpenJDK7 as well.
The fix has been pushed upstream for the JDK8 tree.