Skip to main content

Swing/AWt under Compiz

32 replies [Last post]
oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

Hi,

I have a bug 6429775 (Xgl/Compiz/Java 1.5/Swing problem) which I considered fixed (long time ago),
but according to comments on this bug we still have some problems under Compiz :(
I've tried NB 6rc1+jdk6u3 but everything looks ok on my Ubuntu 7.10 :(
So, I wonder if someone on this forum has experienced the problem and if yes, it would be nice
to know how the problem can be reproducible (and in what environment)

Thanks in advance, Oleg.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vicricker
Offline
Joined: 2007-06-27
Points: 0

I could not reproduce the blank window in about an hour of work with Netbeans under Java 7! Very nice! Unfortunately, there were other problems, tooltips didn't work, the memory meter in the toolbar didn't work, the status bar in the bottom right, that shows when the project is running, or when NB is doing something, would not clear, or maybe the tasks never completed?

I hope the fixes get backported to Java 5 & 6.

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

> I'm not sure if this is related but, one oddity that
> I've noticed, which seems to happen consistently, is
> with the replace dialog opening in the wrong
> location:
> 1. Press CTRL-H to open the Replace dialog
> 2. Press ESC to dismiss it.
> 3. Repeat several times
>
> Even if the replace dialog paints correctly, it will
> still crawl up the screen every time it opens until
> it gets to the top of the screen. Weirder still,
> this doesn't happen with CTRL-O. I thought it might
> be a problem with Netbeans but the problem does not
> happen under JDK5+MToolkit.

I've investigated this issue and found that, most likely, this is a Compiz bug.
So, I've filed bug against Compiz: http://bugs.freedesktop.org/show_bug.cgi?id=13589

Oleg.

danny0085
Offline
Joined: 2010-02-04
Points: 0

Try the new version of VP Suite for linux is an excelent UML tools

http://tips-linux.net/en/content/visual-paradigm-suite-41-linux-license

danny0085
Offline
Joined: 2010-02-04
Points: 0

Try the new version of VP Suite for linux is an excelent UML tools

http://tips-linux.net/en/content/visual-paradigm-suite-41-linux-license

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

Hi Carl,

I've tried to install VP and it looks like it uses its own jre for this and this jre doesn't work well under
Compiz (not a big surprise ;) How can I force VP to use another JRE?

Thanks, Oleg.

rinsewin
Offline
Joined: 2004-06-28
Points: 0

Hi Oleg,

I'm not sure of a clean way of forcing VP to use a different JRE, however I did try the brute force approach i.e.

% cd /VP_Suite3.1
% mv jre /tmp
% cp /usr/lib/jvm/java-6-sun/jre /VP_Suite3.1

Interestingly this resolved the issue under compiz!!! So, it would appear that VP is shipping with a broken version of the JRE (in this case: v5/1.5.0) and its _not_ Java 6 that is causing the issue.

People experiencing this issue with other apps might want to check whether the above brute force workaround applies.

Good catch Oleg, I'll contact the VP developers and point them to this thread.

Thanks,
Carl C.

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

I'm happy to hear that your problem is resolved (if was one the easiest fix for me :)

Let me know if you find another problem.

Good luck, Oleg.

cayuyon
Offline
Joined: 2006-02-16
Points: 0

Hi Oleg!!

I agree with vicricher on all.

Another test case:

1.7.0-ea-b23 + NB 5.5 has no JDialog problems (never!) but the IDE suddenly freezes with a simple refactoring (strace: futex(0xb7dccbd8, FUTEX_WAIT, 30596, NULL.. ) Maybe this issue can be solved more easily.

And.. sorry about my english.

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

The problem you see is, most likely a known bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6598089

It should be be fixed soon.

davie
Offline
Joined: 2008-02-20
Points: 0

Hi Oleg,
there have been quite a few ubuntu bugs - most of them are now marked as duplicates of this one
https://bugs.launchpad.net/fedora/+bug/118983
I can reproduce this most of the time using intellij idea 7 on java 1.6.0_03, ubuntu 7.10.
The easiest way is just to open a java file, put the cursor on a public method, and hit alt-f7 to get the "find usages dialog" - at least one time out of 4 this comes up blank for me.
Intellij provides a free download with evaluation period here http://www.jetbrains.com/idea/download/index.html#linux
any chance you could try that and see if you can reproduce the problem?
Thanks

maurylovesjdk
Offline
Joined: 2008-02-06
Points: 0

Hi you all,
I'm happy to find and join the discussion. I've used Ubuntu to realize my first application for an university course. It works, pretty good to be honest, but some times (in my opinion too times...) it missing the size of the JDialog, JOptionPane appear empty and other strange thing (wrong position, missing component like buttons, JTables, etc...).
I use only gedit and jdk6.0.

Regards

Maurizio

cayuyon
Offline
Joined: 2006-02-16
Points: 0

Good news (maybe):

Trying jdk7 snapshot build 25

http://download.java.net/jdk7/binaries/

And everything seems ok. Any confirmation?

eputrycz
Offline
Joined: 2007-05-17
Points: 0

> Good news (maybe):
>
> Trying jdk7 snapshot build 25
>
> http://download.java.net/jdk7/binaries/
>
> And everything seems ok. Any confirmation?

How compatible is this version with Eclipse, Netbeans and other existing java tools?

Erik.

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

It should be compatible (at least it works fine with NB6.0 for me)

But I would not be so optimistic about disappearing the problem. It is a thread race
and I will not consider it is fixed until I will know for sure the root cause of the problem.

Oleg.

cayuyon
Offline
Joined: 2006-02-16
Points: 0

Compatible and apparently stable with NB 5.5.1

Some recurrent problems with window position and gray screens dissapears for me. 1 day of testing.

kojow7
Offline
Joined: 2008-01-30
Points: 0

I also have this problem with JRE 1.6.0_03-b05. I am trying to run the java program at http://adornthetruth.com/nikamo . I am also running Ubuntu 7.10 and compiz (1:0.6.0)/fusion(0.5.2). It will randomly make a JFrame completely gray. Most of the time the window/frame shows up fine, but about 30% of the time one of the windows will appear with nothing on it.

kojow7
Offline
Joined: 2008-01-30
Points: 0

I can also confirm that this works with Ubuntu 8.04. Sigh. BTW, if anyone is testing this bug and needs the source for the above program you can add /source to the above address. Is there anyone that never runs into this problem running both java and compiz? I would have thought that there'd be a lot more requests to have this bug fixed especially since compiz is now default on Ubuntu.

mbien
Offline
Joined: 2007-04-29
Points: 0

can confirm it too on ubuntu 7.10 and 8.04 beta. This happens on all linux systems with hardware accelerated desktop enabled (ubuntu, kubuntu...kde, mandriva...)

>I would have thought that there'd be a lot more requests to have this bug fixed
>especially since compiz is now default on Ubuntu.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6632124 +
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6429775 +
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509038 =
295 votes
enough requests for me ;-)

it seems like linux systems have simple no priority on the consumer release feature list (even a combo box is not rendered correctly on GTK [6624717]). But the hope dies last...

rinsewin
Offline
Joined: 2004-06-28
Points: 0

Hi Oleg,

This bug can be reproduced on a fresh install of Ubuntu 7.10 "Gutsy Gibbon", with the following settings:

System->Preferences->Appearance->Visual Effects->Normal or Extra

Along with the following application:

Visual Paradigm for UML 6.1 (Visual Paradigm Suite 3.1)
http://www.visual-paradigm.com/download/download.jsp?product=vpsuite
(either use the 30 day trial or the community edition).

This is using java-6-sun-1.6.0.03 installed via Ubuntu's Synaptic Package Manager.

There is nothing special with this installation, everything is out of the box with no tinkering (I installed it all today from scratch).

The issue manifests itself when you initially execute VP-UML, a dialog opens which should ask you which workspace you want to use, but with the Normal/Extra visual effects selected all you get is a blank gray box... the invisible buttons still work however. If you change the visual effects setting to None everything works fine.

It should be noted that setting "AWT_TOOLKIT=MTookkit" results in the dialog box displaying properly, however I haven't been able to demonstrate that this has no side effects on VP-UML yet.

I hope that helps,
Carl C.

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

Hi Carl,

thank you for information. Just one more question:
is the problem reproducible always with this tool?

Thanks, Oleg.

uckelman
Offline
Joined: 2007-11-21
Points: 0

Hi,

Thanks for looking at this. It's a real show-stopper for VASSAL, the open-source Java board game engine for which I'm one of the developers. We have a pretty sizable Linux community and many of them (myself included) want to use Beryl, Compiz, or Compiz Fusion.

Here's a short program which is supposed to load an image (the path of which is given on the command line) and display it in a scroll pane. If I use Compiz Fusion and I choose anything but a tiny image, the image doesn't display, and regardless of the image chosen I get no scroll bars or window decorations.

import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRootPane;
import javax.swing.JScrollPane;

public class Test {
public static void main(String[] args) {
final Image im = Toolkit.getDefaultToolkit().createImage(args[0]);

final JLabel label = new JLabel(new ImageIcon(im));
final JScrollPane scroll = new JScrollPane(label);
final JFrame frame = new JFrame();
frame.add(scroll);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}

For comparison, this works regardless of the image chosen when I use Metacity as my window manager.

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

I see such problem with 1.6.0, but not with 1.6.0_02. What version of java do you use?

uckelman
Offline
Joined: 2007-11-21
Points: 0

This happens for me using 1.7.0-icedtea. With 1.6.0_03 and Compiz Fusion, it fails for me in a different way:

java: xcb_xlib.c:50: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
Aborted

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

the assertion you see is the different issue (which is not specific to Compiz)
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373. It should be fixed in jdk7.0b22.

daigo_k
Offline
Joined: 2007-11-18
Points: 0

Please try to open dialogs many time on NetBeans 6.0 rc1. For example, you try to open following steps many time: tools -> NetBeans Platforms -> close, tools -> Java Platforms -> close, tools -> Ruby Gems -> close ...

Not always, but sometimes dialog is broken. I hope you can reproduce this.

My environment is following:
OS: Ubuntu 7.10
Java: 1.6.0_03
NetBeans: 6.0 rc1

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

thank you for information. It looks like we have a thread race there :(
Will study the code and work under Compiz :(

daigo_k
Offline
Joined: 2007-11-18
Points: 0

If possible, could you chage the status of the following bug to reopen?
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6429775

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

I will not reopen the bug, but I've filed new one - #6632124 (will be visible soon). I do not want to
reopen old one because it was already integrated/verified, and it does really improve the situation
(w/o it I was able to reproduce the problem every time I start NB)

Regards, Oleg.

vicricker
Offline
Joined: 2007-06-27
Points: 0

Thank you for working on this problem. Java has been seriously broken under Linux/compiz for a long time.

I'm running compiz fusion under Fedora 7 (32bit) on AMD X2 6000+.

Under Java 6 update 3:
do 'export AWT_TOOLKIT=MToolkit', run Netbeans 6, press CTRL-O to open to "Go to Type" window, press ESC to dismiss it. Keyboard input no longer works.

Without AWT_TOOLKIT set, it works better but still has occasional blank or screwed up windows. (By screwed up, I mean wrong placement (often top left corner of screen instead of center), wrong size (often very large), blank or partial content (often only a small section of the content in the top left corner is visible, the rest of the window is blank.)) Press CTRL-O or CTRL-H, then ESC several times. You should see the corruption within about 10 tries or so.

Under Java 5 update 13:
With AWT_TOOLKIT unset, run netbeans 6. All you get is a blank window. This happens every time.

With AWT_TOOLKIT=MToolkit, Netbeans 6 mostly works, however, some of the popups do not display, for example, CTRL-TAB to cycle through the files in the editor does not show the popup list of filenames. Also, when you click on the colored bars for local history on the left side of the editor window, the popup toolbar does not display.

I have also applied the sed -i 's/XINERAMA/FAKEEXTN/g' hack if that matters.

While having Java 6 fixed would be nice, I have to target Java 5 when developing software. It'd be nice to have a solution that worked for both versions.

I'd be glad to help if I can.

-Vic
ICQ: 1375882
AIM: vicricker

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

Hi Vic,

> Under Java 6 update 3:
> do 'export AWT_TOOLKIT=MToolkit', run Netbeans 6,
> press CTRL-O to open to "Go to Type" window, press
> ESC to dismiss it. Keyboard input no longer works.

I'm not sure if we will fix bug in MToolkit :(actually we have just removed it in jdk7 ;)

> Without AWT_TOOLKIT set, it works better but still
> has occasional blank or screwed up windows. (By
> screwed up, I mean wrong placement (often top left
> corner of screen instead of center), wrong size
> (often very large), blank or partial content (often
> only a small section of the content in the top left
> corner is visible, the rest of the window is blank.))
> Press CTRL-O or CTRL-H, then ESC several times. You
> should see the corruption within about 10 tries or
> so.

this is what I want to fix. The problem is that in my environment it is much harder
to reproduce the problem :( From the other hand this means that it will be even more interesting
to find and fix the problem :)

> Under Java 5 update 13:
> With AWT_TOOLKIT unset, run netbeans 6. All you get
> is a blank window. This happens every time.

this is because even original fix for 6429775 was not back-ported to 5.0, and I doubt it will be
unless someone (who has support contract) will escalate it.
My target is jdk 7.0 and jdk 6.0uX.

> With AWT_TOOLKIT=MToolkit, Netbeans 6 mostly works,
> however, some of the popups do not display, for
> example, CTRL-TAB to cycle through the files in the
> editor does not show the popup list of filenames.
> Also, when you click on the colored bars for local
> history on the left side of the editor window, the
> popup toolbar does not display.
>
> I have also applied the sed -i
> 's/XINERAMA/FAKEEXTN/g' hack if that matters.

Hope the problem with Xinerama will be also fixed in 6uX soon.

> While having Java 6 fixed would be nice, I have to
> target Java 5 when developing software. It'd be nice
> to have a solution that worked for both versions.

As I said, my target is 7.0 and 6.0uX.

Oleg.

vicricker
Offline
Joined: 2007-06-27
Points: 0

> Hi Vic,
>
> > Without AWT_TOOLKIT set, it works better but still
> > has occasional blank or screwed up windows. (By
> > screwed up, I mean wrong placement (often top left
> > corner of screen instead of center), wrong size
> > (often very large), blank or partial content
> (often
> > only a small section of the content in the top
> left
> > corner is visible, the rest of the window is
> blank.))
> > Press CTRL-O or CTRL-H, then ESC several times.
> You
> should see the corruption within about 10 tries or
> so.
> this is what I want to fix. The problem is that in
> my environment it is much harder
> to reproduce the problem :( From the other hand
> this means that it will be even more interesting
> to find and fix the problem :)
>
> Oleg.

Hi.
Are you not able to reproduce the problems with Netbeans?

I'm not sure if this is related but, one oddity that I've noticed, which seems to happen consistently, is with the replace dialog opening in the wrong location:
1. Press CTRL-H to open the Replace dialog
2. Press ESC to dismiss it.
3. Repeat several times

Even if the replace dialog paints correctly, it will still crawl up the screen every time it opens until it gets to the top of the screen. Weirder still, this doesn't happen with CTRL-O. I thought it might be a problem with Netbeans but the problem does not happen under JDK5+MToolkit.

I also tried to use the Metal LaF under JDK 6 (Netbeans defaults to the system default. Gnome?) but it didn't seem to make a difference.

It's unfortunate that it's only being fixed in Java 6+ since that's not available for Mac yet but I understand.

oleg_sukhodolsky
Offline
Joined: 2006-02-06
Points: 0

> Are you not able to reproduce the problems with
> Netbeans?

I've seen the problem just couple times :(

> I'm not sure if this is related but, one oddity that
> I've noticed, which seems to happen consistently, is
> with the replace dialog opening in the wrong
> location:
> 1. Press CTRL-H to open the Replace dialog
> 2. Press ESC to dismiss it.
> 3. Repeat several times
>
> Even if the replace dialog paints correctly, it will
> still crawl up the screen every time it opens until
> it gets to the top of the screen. Weirder still,
> this doesn't happen with CTRL-O.

I see the problem, will investigate if this is AWT bug.