Menu selection is wrong in Java apps

Bug #878934 reported by Federico Vera
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Compiz Core
Fix Released
Medium
Sam Spilsbury
compiz (Ubuntu)
Fix Released
Medium
Sam Spilsbury
Oneiric
Fix Released
Medium
Unassigned

Bug Description

SRU TESTCASE

1. install openjdk-7-jdk and start the .jar file from comment#2
2. click on the menus of the newly started java window
3. see the menu selection have an offset
4. now install compiz from oneiric-proposed
5. note menus work as they should

When opening a Java app that uses the system's look and feel in Java and said application starts in fullscreen mode then the menus are wrongly selected
I attach a screenshot and a small code (and a compiled jar) that can reproduce the problem.
This happens with default-jdk, sun-java6-jdk, openjdk-6-jdk and openjdk-7-jdk

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: default-jre 1:1.6-42ubuntu2
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Thu Oct 20 12:57:42 2011
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20110901)
SourcePackage: java-common
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Federico Vera (fedevera) wrote :
Revision history for this message
Federico Vera (fedevera) wrote :
Revision history for this message
Federico Vera (fedevera) wrote :
Revision history for this message
Federico Vera (fedevera) wrote :

This bug is not reproducible in unity-2d which means it's actually a unity3d bug, furthermore it applies to all lists and comboboxes, not just menues.

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

I'm not able to reproduce this bug at all with java-7-openjdk. In my case the correct menu gets selected when I move my mouse over it. Could you check if you're running Ubuntu with the latest updates?

Changed in unity:
status: New → Incomplete
Changed in unity (Ubuntu):
status: New → Incomplete
Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

Even after that, this seems to be more of a Java bug to me rather than a compiz/unity bug

Revision history for this message
Omer Akram (om26er) wrote :

bug 755406 could be related.

Revision history for this message
Federico Vera (fedevera) wrote :

I have 6 fully updated ubuntu oneiric pc's, and the same error happens on all of them... the only partial workarround I found is to use Unity-2d.

Omer Akram (om26er)
Changed in unity:
importance: Undecided → Medium
Changed in unity (Ubuntu):
importance: Undecided → Medium
affects: java-common (Ubuntu) → compiz (Ubuntu)
Changed in compiz (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Changed in unity:
status: Incomplete → Confirmed
Changed in unity (Ubuntu):
status: Incomplete → Confirmed
tags: added: op
Omer Akram (om26er)
tags: added: 26p
removed: op
Changed in unity:
assignee: nobody → Sam Spilsbury (smspillaz)
Changed in compiz (Ubuntu):
assignee: nobody → Sam Spilsbury (smspillaz)
Changed in unity (Ubuntu):
assignee: nobody → Sam Spilsbury (smspillaz)
Changed in compiz (Ubuntu Oneiric):
status: New → Confirmed
Changed in unity (Ubuntu Oneiric):
importance: Undecided → Medium
status: New → Confirmed
no longer affects: unity
Changed in unity (Ubuntu):
status: Confirmed → Invalid
Changed in unity (Ubuntu Oneiric):
status: Confirmed → Invalid
Changed in unity (Ubuntu):
assignee: Sam Spilsbury (smspillaz) → nobody
Changed in compiz (Ubuntu Oneiric):
importance: Undecided → Medium
Revision history for this message
Gerhard Radatz (gerhard-radatz) wrote :

I have this same bug and would like to provide this additional information to track down the problem:

-) It did not happen with Ubuntu 11.04 Natty
-) It DOES happen with Ubuntu 11.10 Oneiric, even with the same jvm (oracle 1.6)

-) It happens only if the Frame starts up in maximized mode, but not if the frame starts in non-maximized mode.
-) If you toggle maximized state of the frame off, the offset problem will disappear. Toggling it back on will not make it appear again.
-) To me it seems that the vertical offset is exactly the height of the global menu / window title bar.
-) I currently have my Unity Launcher set to "hide never". This causes popup elements of a java application to be horizontally misplaced: They are shifted to the left by width(launcher) pixels. This horizontal misplacement also is fixed as soon as the maximized state of the frame is changed for the first time.

So, there seems to be some window initialization issue here.

Omer Akram (om26er)
no longer affects: unity (Ubuntu)
no longer affects: unity (Ubuntu Oneiric)
Omer Akram (om26er)
description: updated
Changed in compiz (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Gerhard Radatz (gerhard-radatz) wrote :

Omer, with oneiric-proposed enabled there is currently no newer version of compiz. The most recent version is 1:0.9.6+bzr20110929-0ubuntu6. Didn't it build yet or do I have to reinstall this version?

Revision history for this message
Omer Akram (om26er) wrote :

@ubuntu-sru this upload of compiz can be accepted to oneiric-proposed since the new release of compiz would take a while. seb128 is aware of that.

Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Fido, or anyone else affected,

Accepted compiz into oneiric-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in compiz (Ubuntu Oneiric):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Federico Vera (fedevera) wrote :

I've just test it with:

compiz-gnome amd64 1:0.9.6+bzr20110929-0ubuntu6.1
compiz-plugins-default amd64 1:0.9.6+bzr20110929-0ubuntu6.1
libdecoration0 amd64 1:0.9.6+bzr20110929-0ubuntu6.1
compiz-core amd64 1:0.9.6+bzr20110929-0ubuntu6.1
compiz all 1:0.9.6+bzr20110929-0ubuntu6.1

and seems to be working OK!

Thanks!

tags: added: verification-done
removed: verification-needed
Revision history for this message
Gerhard Radatz (gerhard-radatz) wrote :

@Jean & Chris:
I have just checked it with my own application. It looks much better now, but there is still a problem if the popup is to open near the bottom or right edge of the screen.

Will try to debug this and report back then.

tags: added: verification-needed
removed: verification-done
Revision history for this message
Federico Vera (fedevera) wrote :

This bug also affects precise, since the fix is out it might be right moment to patch precice's version of unity too

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

I can confirm now that the fix works correctly.
The remaining problem I mentioned above is induced by some wrong calculations in my Java code.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Gerhard Radatz (gerhard-radatz) wrote :

I would like to emphasize that the fix above also solves a problem with wine applications:
Popups/popdowns have been misplaced, which was a new bug in oneiric. (Most often they popped up in the upper left edge of the screen).
This also works right now with the fix from oneiric-poposed applied.

Changed in compiz-core:
importance: Undecided → Medium
milestone: none → 0.9.7.0
status: New → Fix Committed
Changed in compiz (Ubuntu):
status: Triaged → Fix Committed
Changed in compiz-core:
assignee: nobody → Sam Spilsbury (smspillaz)
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

With compiz pre-release 0.9.7 from didrocks PPA I am unable to reproduce this issue on precise.

Omer Akram (om26er)
Changed in compiz (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package compiz - 1:0.9.6+bzr20110929-0ubuntu6.1

---------------
compiz (1:0.9.6+bzr20110929-0ubuntu6.1) oneiric-proposed; urgency=low

  * debian/patches/fix_890947_synthetic_notifications.patch:
    - Unity sends initial GDK_CONFIGURE event with position as (0,0).
      (LP: #890947)
  * debian/patches/fix_focus_on_wrong_window_896762.patch:
    - Switching viewports with ctrl-alt-(left/right/up/down) does not
      give the highest window on the target viewport focus. (LP: #896762)
  * debian/patches/java_offset_frame_extents_878934.patch:
    - Menu selection is wrong in Java apps. (LP: #878934)
 -- Omer Akram <email address hidden> Tue, 17 Jan 2012 15:08:38 -0500

Changed in compiz (Ubuntu Oneiric):
status: Fix Committed → Fix Released
Changed in compiz-core:
status: Fix Committed → Fix Released
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.