Bug 213908 - Swing application on Sun Java 1.5 and 1.6 do not fully work with compiz
Swing application on Sun Java 1.5 and 1.6 do not fully work with compiz
Product: Fedora
Classification: Fedora
Component: compiz (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Kristian Høgsberg
Depends On:
  Show dependency treegraph
Reported: 2006-11-03 13:31 EST by Mario Torre
Modified: 2018-04-11 11:34 EDT (History)
4 users (show)

See Also:
Fixed In Version: f8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-11 23:22:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mario Torre 2006-11-03 13:31:57 EST
Description of problem:

This is a known bug in Sun Java, I think we can do very little, I'm just posting
it here with a small workaround so that other people can find it easily and run
java programs until a fix is released from Sun.

The problem is that Swing applications with Sun Java do not work with Compiz and
Desktop effects enabled.

On the net there are a couple of workaround available, but I have found only one
works with fedora core 6.

One suggest to use MToolkit instead of the XToolKit:

export AWT_TOOLKIT=MToolkit

But this requires a library I was not able to find in fedora core 6 (it was in
the x11-deprecated-libs, but now this package seems to be removed).

The one that works with fedora is to install Xephyr and run java programs inside
Xephir, with metacity or another window manager that is not compiz, like the
following snippet shows:

--- cut ---
#! /bin/bash
# run_java.sh
Xephyr :2 -ac -screen 1430x850 &
metacity --display :2 &
export DISPLAY=:2
$1 &
--- cut ---

Just Create a file named run_java.sh with this content, Then just run
./run_java.sh netbeans or ./run_java.sh limewire and you will get a java program
into a Xephyr session, just change -screen values to suite your needs.

While this is a less than optimal solution, it works.

The last workaround is to disable compiz and desktop effects and use metacity
but it is really difficult to come back to the old desktop after you have tried
compiz :)

Version-Release number of selected component (if applicable):

Sun Java, at least from version 1.5.0_05 to 1.5.0_09 and 1.6.0 beta 2; IBM Java
1.5.0 update 3. Other JDK may have the same issues.

How reproducible:

Always, with compiz, some Swing based applications seem to work, but they froze
as soon as the user tries to resize the window.

Steps to Reproduce:
1. enable compiz
2. run a swing application
Actual results:
The application shows a grey windows, froze or does not resize (eventually
stopping to work)

Expected results:
Applications should start and work normally

Additional info:
GCJ seems to work, GNU classpath with Cacao also works. This is a bug in Sun
Java. SWT application are not affected. I have not tested AWT but it seems to
work, too (this is what I've read on the net, at least).

This is a bug enty in Sun Bugzilla that can be tracked:
Comment 1 Mario Torre 2006-11-10 16:09:27 EST
I wanted to add that first workaround proposed (the MToolkit fix), can be
enabled for fedora by installing the package libXp.

I have tested netbeans with this fix and seem to run fine on jdk 1.6 rc and jdk
1.5.0_09, but limewire does not run, maybe other application have issues...
Comment 2 Mario Torre 2007-04-10 07:24:56 EDT
The jdk 1.6.0-u1 (officially released) works with compiz, I've not tested it
with beryl (I know there is a workaround for 1.6, but I don't know if it is
still valid/needed).
Comment 3 Matěj Cepl 2007-10-22 18:06:51 EDT
Reporter, I am not sure what version of compiz you used in April 2007 (sorry, we
missed this bug's activity), but could you check with the latest updates for FC6
(while it is still supported) whether this bug hasn't gone away in meantime, please?
Comment 4 Mario Torre 2007-10-23 07:22:08 EDT
I'm sorry, I'm not in fedora 7.

The bug is somewhat fixed as of release 1.6.0.

You don't need anymore the workaround proposed, but still you get gray windows
when opening dialog boxes. It seems to be quite random, and I'm not sure how to
fix this (I'm still getting this with an updated compiz-4.0 and jdk

I can check with the latest packages in fedora 8 as soon as it gets out, in the
meantime, I'm trying to install compiz-0.6 and compiz-fusion for fedora 7.

I will also test with IcedTea and let you know.

Comment 5 Mario Torre 2007-10-23 07:35:35 EDT
Of course, I mean, "I'm not in Fedora Core 6 anymore"...

Comment 6 Jon Stanley 2008-01-11 23:22:28 EST
As indicated previously there has been no update on the progress of this bug
therefore I am closing it as INSUFFICIENT_DATA. Please re-open if the issue
still occurs for you and I will try to assist in its resolution. Thank you for
taking the time to report the initial bug.
Comment 7 Mario Torre 2008-01-12 04:20:19 EST

Sorry for the long delay in replying. This bug seems to be fixed for IcedTea on
fedora 8, I'm currently using the rawhide version of IcedTea (based on b24:

I don't know if Sun will ever backport this fix to jdk 1.6, I was also told that
it maybe a mixed compiz and java issue.

This bug was really about jdk and was a reference to the sun bug 6429775, and
not openjdk, so I don't know if you can simply mark this as fixed in rawhide or
just leave as closed/insufficient_data.

Please, note also that NetBeans 6.0 currently does not work well with IcedTea.


Note You need to log in before you can comment on or make changes to this bug.