Ubuntu

Regression: Unreadable menu bar with Ambiance theme in Java/Swing GTK L&F

Reported by flux on 2012-02-14
402
This bug affects 81 people
Affects Status Importance Assigned to Milestone
OpenJDK
Fix Committed
Undecided
Unassigned
light-themes
Invalid
Undecided
Unassigned
light-themes (Ubuntu)
Undecided
Unassigned
openjdk-6 (Ubuntu)
Undecided
Unassigned
openjdk-7 (Ubuntu)
Undecided
Unassigned

Bug Description

Hi, I have a problem in netbeans (and other java applications) with Ambiance theme. The menu bar has a dark foreground color and the menu titles are unreadable. This problem didn't occur in Oneiric.

flux (luigimarco) wrote :

Please could you post an exact list of actions to replicate the problem (eg. including which package(s) to install and exactly how you start them).

summary: - Unreadable menu bar with Ambiance theme
+ Regression: Unreadable menu bar with Ambiance theme
summary: - Regression: Unreadable menu bar with Ambiance theme
+ Regression: Unreadable menu bar with Ambiance theme with Netbeans
Changed in light-themes (Ubuntu):
status: New → Incomplete
flux (luigimarco) wrote :

Yes, I mean...
the problem occurs with netbeans, installed from ubuntu precise repo. I use the Ambiance theme and, when I open netbeans, the menubar is unreadable, as you can see in the attached image. With Radiance theme the problem doesn't occur, probably because the menubar of java applications, with the Ambiance theme, is too dark (and too similar) compared with the background.

Alan Pater (alan-pater) wrote :

The java application SweetHome3D also has this problem under 12.04 using the Ambiance theme.

A similiar issue occurs on window buttons and the calendar applet when using a Gnome session. See bug #933305.

Alan Pater (alan-pater) on 2012-03-08
Changed in light-themes (Ubuntu):
status: Incomplete → Confirmed
Bob Bib (bobbib) on 2012-03-11
tags: added: precise regression-release
summary: - Regression: Unreadable menu bar with Ambiance theme with Netbeans
+ Regression: Unreadable menu bar with Ambiance theme with Java apps

I confirm this issue, at least on SweetHome3D.
This is specific to Ambiance theme.
A workaround is to switch to Radiance theme, on which the contrast is ok

Adolfo Jayme (fitoschido) wrote :

I think this regression happened since the switch to bright menus in Ambiance GTK2. A workaround would be using the Oneiric version of Ambiance GTK2 (just copy the gtkrc file in /usr/share/themes/Ambiance/gtk-2.0/gtkrc to your Precise installation)

Changed in light-themes:
status: New → Confirmed
flux (luigimarco) wrote :

where we can find this gtkrc? However... this is a serious problem... no application is usable :(

Mossroy (mossroy) wrote :

Version 0.1.9-0ubuntu1 of light-themes (recently released in standard repos) does not fix this issue.
I still have the menu contrast issue, at least in SweetHome3D

flux (luigimarco) wrote :

waiting for a definitive solution...

I have a workaround:
- copy Ambiance theme in my home directory from /usr/share/themes to ~/.themes.
- open the file gtk2.0/gtkrc
- replace the line
     style "menu" {
with the line
    style "menu" = "dark" {

I hope this is useful for now.

Ales Katona (almindor) wrote :

All swing Java applications have this problem if they decide to use native look. This includes netbeans, Jitsi (the SIP communicator) and possibly quite a lot of others.

Jesse Glick (jesse-glick) wrote :

Confirmed in Precise Beta 2 running Ambiance with a variety of JDK 6 and 7 releases using bin/java -jar demo/jfc/SwingSet2/SwingSet2.jar after switching L&F to GTK (via the menu item provided for this purpose).

summary: - Regression: Unreadable menu bar with Ambiance theme with Java apps
+ Regression: Unreadable menu bar with Ambiance theme in Java/Swing GTK
+ L&F
Andrea Cimitan (cimi) wrote :

It's a bug in Java

Wrongly read theming info?

Dňa 27. apríla 2012 18:33, Andrea Cimitan
<email address hidden>napísal(-a):

> It's a bug in Java
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (975894).
> https://bugs.launchpad.net/bugs/932274
>
> Title:
> Regression: Unreadable menu bar with Ambiance theme in Java/Swing GTK
> L&F
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/light-themes/+bug/932274/+subscriptions
>

--
Feel the power of Opensource.
Feel the power of Free Pascal.

flux (luigimarco) wrote :

Actually I have this problem only with Ambiance theme... I don't know if it's a java bug or not

Andrea Cimitan (cimi) wrote :

Yeah I think so... Someone needs to test which color is picked up, maybe the color of the text in the menu

Jesse Glick (jesse-glick) wrote :

Duplicate #975894 comment #6 & comment #7 have useful information about cause.

Andrea Cimitan (cimi) wrote :

Ok, so it's a java/swing bug.
The commit chances the "menu" but here is affecting "the menubar".
I am 90% sure that the menubar text color in java apps is picked up by the menu text color.

Andrea Cimitan (cimi) wrote :

*changes

Andrea Cimitan (cimi) on 2012-04-27
Changed in light-themes:
status: Confirmed → Invalid
Changed in light-themes (Ubuntu):
status: Confirmed → Invalid

Andrea you've commited http://bazaar.launchpad.net/~ubuntu-art-pkg/light-themes/trunk/revision/179#Ambiance/gtk-2.0/gtkrc and reverting it makes java apps menu normal again. Why now you mark this as invalid?

Ales Katona (almindor) wrote :

I think that perhaps that change shouldn't affect the text color (although border was also changed??). I plan to look into JDK/swing's sources for theming info with native gtk look and see what they read as what, but am quite busy with other things atm.

Andrea Cimitan (cimi) wrote :

Marko, that commit exposes a bug in java apps. Ales is right.

OK, until this gets resolved proper way I've created PPA with light-themes that works around thiss issue:

https://launchpad.net/~marko-techytalk.info/+archive/light-themes

Regards,
Marko

Kavan Soleimanbeigi (solxiom) wrote :

There is another problem due to same bug, NetBeans should show the main project title in bold text, but now all projects titles in the list are in bold

David Edwards (purple52) wrote :

Which package should this bug be marked as affecting, if the theme is technically correct? Does it need reporting upstream? It would be good to get it tracked in the right place, to avoid it being forgotten/ignored.

Jesse Glick (jesse-glick) wrote :

I filed Java bug #7169111.

enz (markus-enzenberger) wrote :

Would it be possible to revert the change in the theme until the bug is fixed (especially if it won't be fixed quickly)?

If this is a bug in Java, then it certainly should be fixed there and not covered up. But from the viewpoint of an end user, the fact is that all applications based on Java Swing have been broken with the default theme of Ubuntu for several weeks now. And an end user is not interested in any finger pointing of developers whose fault it is, he simply has a bad user experience.

In the future, it would be nice if changes in the themes were tested with all major GUI toolkits (GTK, Qt, Java Swing) before they are committed.

Ales Katona (almindor) wrote :

I would like to add that this affects also the GNOME classic main panel
menu (the font is also "dark gray on black", and sadly Radiance theme is
also broken with "white gray on white. It might be 2 issues but the bad
colors seem too conveniently similar.

2012/5/17 enz <email address hidden>

> Would it be possible to revert the change in the theme until the bug is
> fixed (especially if it won't be fixed quickly)?
>
> If this is a bug in Java, then it certainly should be fixed there and
> not covered up. But from the viewpoint of an end user, the fact is that
> all applications based on Java Swing have been broken with the default
> theme of Ubuntu for several weeks now. And an end user is not interested
> in any finger pointing of developers whose fault it is, he simply has a
> bad user experience.
>
> In the future, it would be nice if changes in the themes were tested
> with all major GUI toolkits (GTK, Qt, Java Swing) before they are
> committed.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (975894).
> https://bugs.launchpad.net/bugs/932274
>
> Title:
> Regression: Unreadable menu bar with Ambiance theme in Java/Swing GTK
> L&F
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/light-themes/+bug/932274/+subscriptions
>

--
Feel the power of Opensource.
Feel the power of Free Pascal.

David Edwards (purple52) wrote :

This is the bug that Jesse filed; thanks!:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7169111

To Do (entodoays) wrote :

I have the same problem with Freeplane 1.2.14. I worked around the issue by using a different Freeplane theme that overrides the default Ubuntu menu behaviour.

Christoph Strobel (chrisstr) wrote :

Interestingly, it doesn't appear in IntelliJ IDEA Community Edition 11.1.2 while in RubyMine 4.0.3 the wrong menu font color can still be seen.
Both running at the same time on Oracle JDK 7 64-Bit (build 23.1-b03, mixed mode), IDEA got it correct and RubyMine doesn't.
Can anybody confirm that? Maybe there is some kind of workaround implemented in IDEA?

Miklos Juhasz (mjuhasz) wrote :

>Maybe there is some kind of workaround implemented in IDEA?

Yes, IntelliJ IDEA has a lot of workarounds for the GTK theme (you can check them in the community edition source).

For the JMenu to look good on Ubuntu they call setForeground and setBackground with hardcoded color values if Ambiance theme is detected.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-6 (Ubuntu):
status: New → Confirmed
Changed in openjdk-7 (Ubuntu):
status: New → Confirmed
ks07 (gfield145) wrote :

This bug also seems to affect the drop-down menus when clicking any of these options, in that the menu background is solid grey and has no border/outline. I would post a screenshot, but print screen doesn't work when the menu is selected...

Miklos Juhasz (mjuhasz) wrote :

Yes, there are several issues with the Java Swing GtkTheme:

- menu bar picking up wrong colors
- dropdown menus and context menus have no border
- dropdown menus and context menus are missing dropdown-shadow
- menu separators are missing

In an ideal world this would be fixed in the JDK... but as a Java developer I can only fix my app to make it look decent in Ubuntu 12.04 by

- setting the menu color explicitly if under Gtk Ambiance theme
- using heavy-weight popups so that they have border and dropdown-shadow
- explicitly setting the y thickness so that menu separators show up

All these workarounds can be examined e.g. in this source: https://github.com/mjuhasz/BDSup2Sub/blob/2180016ff01de9c0a056f743387b90c2de11b2d4/src/main/java/bdsup2sub/gui/support/GuiUtils.java

Sergio Benjamim (sergio-br2) wrote :

I have this issue in Ubuntu 12.04, using apps like Netbeans, Arduino and Scilab.

Dan Jared (danjaredg) wrote :

I create the Java Ayatan proyect http://code.google.com/p/java-swing-ayatana/ to integrate a java swing applications with Ubuntu, for the moment, I create a netbeans plugin http://plugins.netbeans.org/plugin/41822/?show=true.

But I can integrate any Java Swing Application with Ubuntu, but I need help to include this libraries (C library and Java Libraries) in a ppa repository.

If anyone knows, please help me...

Dan Jared (danjaredg) wrote :

The plugin http://plugins.netbeans.org/plugin/41822/?show=true resolve the application menu integration and Launcher integration. Only need install Netbeans by default and install the plugin Java Ayatana

estama (estama) wrote :

Is there a reason why the people responsible for the Ambience theme, do not use the following:

https://bugs.launchpad.net/ubuntu/+source/light-themes/+bug/932274/comments/9

solution?

Do you consider it acceptable, to have Java swing apps menus broken in Ubuntu for nearly a year? Why?

Andrea Cimitan (cimi) wrote :

@estama:
that will break the look of firefox and tb menus

estama (estama) wrote :

Andrea many many thanks for the explanation. Nevertheless i have one more question.

Firefox doesn't have any menu any more, and both firefox and thunderbird have unity menu integration in quantal. Would putting the "style" change still affect them?

Andrea Cimitan (cimi) wrote :

the awesome bar menu (bar with addresses) will become dark, as it was before, which looked a bit out of place and not nice at all :)

Mossroy (mossroy) wrote :

I confirm that switching to openjdk 7 instead of openjdk6 solves the issue on my computer :

sudo apt-get install openjdk-7-jdk icedtea-7-plugin
sudo update-java-alternatives -s java-1.7.0-openjdk

That's good news.
Unfortunately, openjdk-6 is still the default JVM on Ubuntu 12.04 (see packages default-jdk and default-jre)

Shouldn't the fix be backported to openjdk 6, so that all the Swing applications appear correctly by default on Ubuntu 12.04?
I suppose the status for openjdk-7 should be changed as "fix released"?

Bob Bib (bobbib) on 2012-10-13
Changed in openjdk:
status: New → Fix Committed
Sergio Benjamim (sergio-br2) wrote :

This trick...

"flux (luigimarco) wrote on 2012-04-15: #9
waiting for a definitive solution...

I have a workaround:
- copy Ambiance theme in my home directory from /usr/share/themes to ~/.themes.
- open the file gtk2.0/gtkrc
- replace the line
     style "menu" {
with the line
    style "menu" = "dark" {

I hope this is useful for now."

... worked to me.

M Morris (mfm773) wrote :

Man, this is irritating. My low-ball workaround is to switch to "high contrast" theme when working on a swing app, but that's got it's own bugs for other stuff, so it's not a very good one.

Mossroy (mossroy) wrote :

This seems to be solved in Ubuntu 14.04 (alpha). I checked with Netbeans and sweethome3d : both have readable menus

Mossroy (mossroy) wrote :

I forgot to add that I tested with opendjk7 (version 1.7.0_51), which is currently the default jdk under Trusty

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers