Java incompatibilities with GTK theme -- Dapper Flight 5

Bug #34688 reported by Mike Perry
24
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Medium
Unassigned
ubuntulooks (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Hi there,
I'm not even sure if this is worth mentioning, but it does effect ubuntu java users who use the Human gtk theme. Here it goes...

When using a Java application that can use the GTK engine all MenuItems do not appear to highlight properly. You can click a MenuItem dropdown and move your mouse over each item. They should highlight atleast simular to clicking on regular gnome menus (as they do with ClearLooks gtk theme).

There is also atleast one other issue that is explained better below.

Steps to repro:
Install Sun's JDK 5 following the instructions from https://wiki.ubuntu.com/RestrictedFormats. Please ensure to run the update-alternatives afterwards.

Once installed open a terminal and run the following:
 java -jar /usr/lib/j2sdk1.5-sun/demo/plugin/jfc/SwingSet2/SwingSet2.jar

That should open up the SwingSet demo.

Select the second icon on the top row

Click on the Look and Feel menu item and select GTK Look and feel. Notice the high menu highlights as you move through each option.

Once the GTK theme is loaded browse through the menu's... notice that they no longer highlight.

Select the first icon on the menu and examine the console. You should notice some exceptions like the following:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Color parameter outside of expected range: Red Green Blue
        at java.awt.Color.testColorValueRange(Color.java:285)
        at java.awt.Color.<init>(Color.java:369)
        at java.awt.Color.<init>(Color.java:344)
        at com.sun.java.swing.plaf.gtk.Metacity.parseColor(Metacity.java:1582)
        at com.sun.java.swing.plaf.gtk.Metacity.drawTitle(Metacity.java:948)
        at com.sun.java.swing.plaf.gtk.Metacity.draw(Metacity.java:1347)
        at com.sun.java.swing.plaf.gtk.Metacity.drawInclude(Metacity.java:1299)
        at com.sun.java.swing.plaf.gtk.Metacity.draw(Metacity.java:1321)
        at com.sun.java.swing.plaf.gtk.Metacity.drawPiece(Metacity.java:1375)
        at com.sun.java.swing.plaf.gtk.Metacity.paintFrameBorder(Metacity.java:4 18)
        at com.sun.java.swing.plaf.gtk.GTKPainter.paintInternalFrameBorder(GTKPa inter.java:253)
        at javax.swing.plaf.synth.SynthInternalFrameUI.paintBorder(SynthInternal FrameUI.java:176)
        at javax.swing.plaf.synth.SynthBorder.paintBorder(SynthBorder.java:45)
        at javax.swing.JComponent.paintBorder(JComponent.java:903)
        at javax.swing.JComponent.paint(JComponent.java:1006)
        at javax.swing.JComponent.paintChildren(JComponent.java:842)
        at javax.swing.JComponent.paint(JComponent.java:1014)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:559)
        at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
        at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
        at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System EventQueueUtilities.java:114)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh read.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre ad.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Now I know what your thinking. Sun has a horrible implementation of GTK... I just figured I would point out these incompatibilities. I may try my luck w/ Sun as well.

Revision history for this message
Jan Mynarik (jan-mynarik) wrote :

It seems that this bug has been confirmed in forums

http://ubuntuforums.org/showthread.php?t=149161

Revision history for this message
Etienne LB (etiennelb-deactivatedaccount) wrote :

I confirm that bug. Some applications can't be used...

Revision history for this message
Etienne LB (etiennelb-deactivatedaccount) wrote :

The application's (like IntelliJ) buttons, text, textarea, menus, etc. in the main window are invisible, but clickable. The popup menus are visible, like children windows.
Changing the LaF doesn't change anything on the main window.

Changed in ubuntulooks:
status: Unconfirmed → Confirmed
Revision history for this message
Richard Stellingwerff (remenic) wrote :

I haven't yet looked at the problem (my laptop harddisk died on me yesterday), but could it be that Java's native LaF doesn't play nice with cairo?

Could someone try with other cairo based GTK+ themes?

Revision history for this message
Mike Perry (mike.perry) wrote :

Which other themes are cario based? If you let me know I can test it.

Aldous Peñaranda (dous)
Changed in ubuntulooks:
assignee: nobody → motujava
Revision history for this message
Dean Sas (dsas) wrote :

Is this still an issue?

Changed in ubuntulooks:
status: Confirmed → Needs Info
Revision history for this message
Jan Mynarik (jan-mynarik) wrote :

Still the same behaviour in Edgy: sun-java5 1.5.0-07-0ubuntu1. The same exception appears as described. The menu items are higlighted even with GTK look'n'feel, the color difference is very small though (it's almost not visible that something is being highlighted).

Also the first thing that appears on terminal after choosing GTK look'n'feel:
/usr/share/themes/Human/gtk-2.0/gtkrc:70: Engine "ubuntulooks" is unsupported, ignoring
/usr/share/themes/Human/gtk-2.0/gtkrc:240: Priority specification is unsupported, ignoring

Revision history for this message
R. A. Rivas Diaz (rivasdiaz) wrote : Solved in Mustang (Re: Java incompatibilities with GTK theme -- Dapper Flight 5)

This problem is solved in upcomming Mustang release. I have downloaded and tested Java 1.6.0-beta2 and the problem is already solved in this version. Java 6 comes with a better implementation of GTK Look and Feel, and in the beta2 release the reported error is not seen anymore.

The support for GTK LAF in Java 5 is not very good, and only some predefined themes are supported. As Human not ClearLooks are officially supported, this probably won't be solved.

Java 6 comes with a much improved GTK LAF, which uses native GTK functions to get info related to the GTK theme. Because of this, the GTK LAF implementation will support all GTK themes. (Still GTK LAF has some errors, but the implementation is much better)

As the changes are too big, I doubt Sun will backport the new GTK LAF to current Java 5, but in Java 6 we won't see this error anymore.

Revision history for this message
Daniel Holbach (dholbach) wrote :

I'm inclined to close the bug as we can by no means fix this.

Revision history for this message
R. A. Rivas Diaz (rivasdiaz) wrote :

I bote also to close this as won't be fixed, if possible with a comment saying fixed in java 6, not supported in java 5.

Revision history for this message
Mike Perry (mike.perry) wrote :

Many Java applications are still written for java 1.4.2. I have seen other gtk themes work fine in 1.4.2 and 1.5.x. That being said there should be a way to get it to function properly with the existing GTK interface in Java.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks for following up, will be fixed in Java.

Changed in ubuntulooks:
assignee: motujava → nobody
importance: High → Medium
status: Needs Info → Rejected
Changed in ubuntulooks:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
jason friedlander (jason-taoish) wrote :

using this argument when you start java will alleviate the problem in the cases i've tested (intellij)

-Dawt.toolkit=sun.awt.motif.MToolkit

i have verified this on 7.04 where

JDK_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.11
and
JDK_HOME=/usr/lib/jvm/java-1.6-sun-1.6.0.00

Revision history for this message
adouba (mba-frafina) wrote :

jason, how do you apply the argument "-Dawt.toolkit=sun.awt.motif.MToolkit"?
I am using jdk6>

thanks,

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 alpha using openjdk and the new testing theme?

Changed in ubuntulooks:
status: Confirmed → Incomplete
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!.

Changed in ubuntulooks:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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