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

Bug #932274 reported by flux on 2012-02-14
406
This bug affects 82 people
Affects Status Importance Assigned to Milestone
Iced Tea
Fix Released
Medium
OpenJDK
Fix Committed
Undecided
Unassigned
Ubuntu theme
Undecided
Unassigned
openjdk-6 (Ubuntu)
Undecided
Tiago Stürmer Daitx
openjdk-7 (Ubuntu)
Undecided
Unassigned
ubuntu-themes (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
Adolfo Jayme (fitojb) on 2012-03-17
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 (fitojb) 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

Tiago Stürmer Daitx (tdaitx) wrote :

OpenJDK 7 has the fix since 7u45 was released - the actual fix came with IcedTea 2.4.0 [1]. Setting OpenJDK 7 bug report as invalid according to Ubuntu's bug status policy [2].

[1] http://blog.fuseyism.com/index.php/2013/06/10/icedtea-2-4-0-released/
[2] https://wiki.ubuntu.com/Bugs/Bug%20statuses

Changed in openjdk-7 (Ubuntu):
status: Confirmed → Invalid

Created attachment 1474
S7169111: Unreadable menu bar with Ambiance theme in GTK L&F

Description:
Using JDK 6 run any Swing app with a menu bar in Ubuntu 12.04 using the default Ambiance theme. The menu bar will be visible, but the text ("File") will be in dark grey on black, nearly unreadable. The menu text is only readable when the menu is selected.

Fix:
S7169111 [1] was applied to OpenJDK 7 and integrated into IcedTea 2.4.0, but no backport was made to OpenJDK 6 and that still affects Ubuntu users running OpenJDK 6.

I would like ask for a backport review in order to incorporate this patch into OpenJDK 6/IcedTea 1.x. Apart from a small fuzz the original patch [2] applies OK - the one attached has been refreshed and should apply cleanly.

References:
[1] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7169111
[2] http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/05c69338ee73

Changed in openjdk-6 (Ubuntu):
assignee: nobody → Tiago Stürmer Daitx (tdaitx)
status: Confirmed → In Progress
Changed in icedtea:
importance: Unknown → Medium
status: Unknown → Confirmed

Scheduled for 1.13.10.

Changed in icedtea:
status: Confirmed → In Progress
Adolfo Jayme (fitojb) on 2015-12-17
affects: light-themes (Ubuntu) → ubuntu-themes (Ubuntu)
affects: light-themes → ubuntu-themes

details: http://icedtea.classpath.org//hg/icedtea6?cmd=changeset;node=eab534910a1a
author: Andrew John Hughes <email address hidden>
date: Wed Jan 20 03:36:30 2016 +0000

 Add new backports for issues to be fixed in 1.13.10.

 S7169111, PR2757: Unreadable menu bar with Ambiance theme in GTK L&F
 S8140620, PR2711: Find and load default.sf2 as the default soundbank on Linux

 2016-01-19 Andrew John Hughes <email address hidden>

  * Makefile.am:
  (ICEDTEA_PATCHES): Add new patches.
  * NEWS: Updated.
  * patches/openjdk/7169111-pr2757-unreadable_menu_bar_with_ambiance_theme.patch,
  * patches/openjdk/8140620-pr2711-find_default.sf2.patch:
  New backports for issues to be fixed in 1.13.10.

details: http://icedtea.classpath.org//hg/release/icedtea6-1.13?cmd=changeset;node=8554f062d23d
author: Andrew John Hughes <email address hidden>
date: Thu Jan 21 01:22:57 2016 +0000

 Add new backports for issues to be fixed in 1.13.10.

 S7169111, PR2757: Unreadable menu bar with Ambiance theme in GTK L&F
 S8140620, PR2711: Find and load default.sf2 as the default soundbank on Linux

 2016-01-19 Andrew John Hughes <email address hidden>

  * Makefile.am:
  (ICEDTEA_PATCHES): Add new patches.
  * NEWS: Updated.
  * patches/openjdk/7169111-pr2757-unreadable_menu_bar_with_ambiance_theme.patch,
  * patches/openjdk/8140620-pr2711-find_default.sf2.patch:
  New backports for issues to be fixed in 1.13.10.

Changed in icedtea:
status: In Progress → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openjdk-6 - 6b38-1.13.10-0ubuntu0.12.04.1

---------------
openjdk-6 (6b38-1.13.10-0ubuntu0.12.04.1) precise-security; urgency=high

  * Backport to Ubuntu 12.04.

openjdk-6 (6b38-1.13.10-0ubuntu0.15.10.1) wily-security; urgency=medium

  * IcedTea 1.13.10 release.
  * Security fixes:
    - S8059054, CVE-2016-0402: Better URL processing
    - S8130710, CVE-2016-0448: Better attributes processing
    - S8133962, CVE-2016-0466: More general limits
    - S8137060: JMX memory management improvements
    - S8139012: Better font substitutions
    - S8139017, CVE-2016-0483: More stable image decoding
    - S8140543, CVE-2016-0494: Arrange font actions
    - S8143185: Cleanup for handling proxies
    - S8143941, CVE-2015-8126, CVE-2015-8472: Update splashscreen displays
  * Other fixes:
    - S7169111, PR2757: Unreadable menu bar with Ambiance theme in GTK L&F
      (LP: #932274)
  * debian/rules: removed old @op@, @pkg_version@, and @pkg_sversion@
  * debian/control.in: replaced @op@ with =, @pkg_version@ with
    ${binary:Version}, and @pkg_sversion@ by ${source:Version}
  * debian/control.cacao-jre: same
  * debian/control.jamvm-jre: same
  * debian/control.zero-jre: same

 -- Tiago Stürmer Daitx <email address hidden> Tue, 26 Jan 2016 13:21:11 +0000

Changed in openjdk-6 (Ubuntu):
status: In Progress → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openjdk-6 - 6b38-1.13.10-0ubuntu0.14.04.1

---------------
openjdk-6 (6b38-1.13.10-0ubuntu0.14.04.1) trusty-security; urgency=high

  * Backport to Ubuntu 14.04.

openjdk-6 (6b38-1.13.10-0ubuntu0.15.10.1) wily-security; urgency=medium

  * IcedTea 1.13.10 release.
  * Security fixes:
    - S8059054, CVE-2016-0402: Better URL processing
    - S8130710, CVE-2016-0448: Better attributes processing
    - S8133962, CVE-2016-0466: More general limits
    - S8137060: JMX memory management improvements
    - S8139012: Better font substitutions
    - S8139017, CVE-2016-0483: More stable image decoding
    - S8140543, CVE-2016-0494: Arrange font actions
    - S8143185: Cleanup for handling proxies
    - S8143941, CVE-2015-8126, CVE-2015-8472: Update splashscreen displays
  * Other fixes:
    - S7169111, PR2757: Unreadable menu bar with Ambiance theme in GTK L&F
      (LP: #932274)
  * debian/rules: removed old @op@, @pkg_version@, and @pkg_sversion@
  * debian/control.in: replaced @op@ with =, @pkg_version@ with
    ${binary:Version}, and @pkg_sversion@ by ${source:Version}
  * debian/control.cacao-jre: same
  * debian/control.jamvm-jre: same
  * debian/control.zero-jre: same

 -- Tiago Stürmer Daitx <email address hidden> Tue, 26 Jan 2016 13:21:11 +0000

Changed in openjdk-6 (Ubuntu):
status: In Progress → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openjdk-6 - 6b38-1.13.10-0ubuntu0.15.10.1

---------------
openjdk-6 (6b38-1.13.10-0ubuntu0.15.10.1) wily-security; urgency=medium

  * IcedTea 1.13.10 release.
  * Security fixes:
    - S8059054, CVE-2016-0402: Better URL processing
    - S8130710, CVE-2016-0448: Better attributes processing
    - S8133962, CVE-2016-0466: More general limits
    - S8137060: JMX memory management improvements
    - S8139012: Better font substitutions
    - S8139017, CVE-2016-0483: More stable image decoding
    - S8140543, CVE-2016-0494: Arrange font actions
    - S8143185: Cleanup for handling proxies
    - S8143941, CVE-2015-8126, CVE-2015-8472: Update splashscreen displays
  * Other fixes:
    - S7169111, PR2757: Unreadable menu bar with Ambiance theme in GTK L&F
      (LP: #932274)
  * debian/rules: removed old @op@, @pkg_version@, and @pkg_sversion@
  * debian/control.in: replaced @op@ with =, @pkg_version@ with
    ${binary:Version}, and @pkg_sversion@ by ${source:Version}
  * debian/control.cacao-jre: same
  * debian/control.jamvm-jre: same
  * debian/control.zero-jre: same

 -- Tiago Stürmer Daitx <email address hidden> Mon, 25 Jan 2016 02:40:51 +0000

Changed in openjdk-6 (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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