java jwindow focus handling is buggy under compiz

Bug #930764 reported by Gerhard Radatz
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Compiz
Invalid
Undecided
Unassigned
Compiz Core
Invalid
Undecided
Unassigned

Bug Description

I have a java (swing) application running under java-7-openjdk with the following problem:
If the app opens a popup window of type "JWindow", the window (and the component in it) receives input focus. However, clicking the already focused component again results in a "focus lost" and "window focus lost" event, before the focus is re-transferred to the window and the component in it.

This bug does not occur if a JDialog pops up.
This bug does not occur with Unity-2D, that's why I think that the bug is caused by compiz.
This bug did not occur under Natty.

I have attached a small demo program to show the bug. Run the prog and watch the output on system.out when clicking multiple times on the already open popups: The JDialog works ok, The JWindow does not.
Run the same program under Unity-2D. Both popups work ok.

I currently have compiz version 1:0.9.6+bzr20110929-0ubuntu6.1 to fix bug 878934.

Revision history for this message
Gerhard Radatz (gerhard-radatz) wrote :
tags: added: amd64 oneiric running-unity
Revision history for this message
Gerhard Radatz (gerhard-radatz) wrote :

I have attached the demo program as runnable jar also.
Run with java -jar DebugFocusMain.jar

Revision history for this message
Gerhard Radatz (gerhard-radatz) wrote :

I should add that this is not just a cosmetics problem:
The JWindow acts as a popup which should close automatically as soon as it looses focus. With this bug now, the window looses focus as soon as the user clicks somewhere *into* it, which makes working with the window impossible!

Revision history for this message
John Bledsoe (jcbledsoe) wrote :

I've seen this exact problem on Ubuntu 10.04 and Ubuntu 12.04 (Compiz 0.9.7.8). The workaround in 10.04 was setting the Visual Effects tab to "None". Now that I've upgraded to 12.04, I haven't figured out how to do that yet. This also occurs with current Oracle JDKs not just java-7-openjdk.

Revision history for this message
Gerhard Radatz (gerhard-radatz) wrote :

John, setting Visual Effects to None effectively disabled compizin 10.04. Since Unity is a compiz plugin, the only way to achieve this under 12.04 would be to select "Unity2D" at login.

Revision history for this message
John Bledsoe (jcbledsoe) wrote :

Thanks Gerhad. I just discovered this myself. Still hope this gets fixed.

Sergiu (sgumanea)
no longer affects: ubuntu
Revision history for this message
Eleni Maria Stea (hikiko) wrote :

Thank you for taking the time to report this bug. As part of the general cleanup we have to close it (old and cannot be reproduced anymore). If you still experience the problem in one of the supported releases though, please feel free to re-open it (change the status bug to new or confirmed).

Changed in compiz:
status: New → Invalid
Changed in compiz-core:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.