eclipse: tooltips unreadable

Bug #540332 reported by Pavel Rojtberg on 2010-03-17
478
This bug affects 101 people
Affects Status Importance Assigned to Milestone
light-themes
Fix Released
Medium
eclipse (Ubuntu)
Low
Unassigned
Lucid
Undecided
Unassigned
light-themes (Ubuntu)
Low
Unassigned
Lucid
Undecided
Unassigned

Bug Description

Binary package hint: light-themes

the tooltip that appears when you hover with the mouse over some code uses black font on black background..

ProblemType: Bug
Architecture: i386
Date: Wed Mar 17 16:39:00 2010
DistroRelease: Ubuntu 10.04
Package: light-themes 0.1.5.8
PackageArchitecture: all
ProcEnviron:
 LANG=de_DE.utf8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-16.25-generic
SourcePackage: light-themes
Uname: Linux 2.6.32-16-generic i686

Pavel Rojtberg (rojtberg) wrote :
Vish (vish) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.
Could you provide a screenshot of the problem? It would help us understand the problem better. [not everyone has eclipse installed]

Changed in light-themes (Ubuntu):
status: New → Incomplete

I confirm this bug. I use Ubuntu 9.10 and eclipse 3.5.2.
There is workaround:
export GDK_NATIVE_WINDOWS=1
See: http://ubuntuforums.org/showthread.php?t=1305012

Pavel Rojtberg (rojtberg) wrote :

@adam:
no this is a theming issue. I am already using NATIVE_WINDOWS.

Vish (vish) on 2010-03-19
Changed in light-themes (Ubuntu):
status: Incomplete → New
Jonas Schwabe (jonas-schwabe) wrote :

The problem appears not only with the new themes, new wave or other themes that were available and working with eclipse during the last release does not work as expected now. Are you sure this is a bug in the light-themes package?

Vish (vish) wrote :

Confirming bug from dups

Changed in light-themes (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Slug (slugzero) wrote :

Looks like there is no way to configure this in the preferences, however the following works for me to set the tooltip background in Eclipse CDT to the familiar yellow from Human:

Modify or add the following lines in
eclipse_workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs

sourceHoverBackgroundColor=245,245,181
sourceHoverBackgroundColor.SystemDefault=false

Klaus Purer (klausi) wrote :

@Slug: This works for me only once after starting Eclipse, hovering over another variable or method shows the black in black tooltip again.

mathieg2 (graeme-salsaholics) wrote :

Found a better workaround. None of the suggested ones worked for me.

In ubuntu,

right click on desktop,
click change desktop background,
click theme,
click customise,
click colours
Change background colour back to yellow, and foreground colour to black.

mathieg2 (graeme-salsaholics) wrote :

Cant find an edit button - but Its the tooltip background colour you set to yellow.

You can also do:

System > Preferences > Appearance
Click Customize ...
Select the Colors tab
Set the background color for Tooltips to #F6F88B
Set the foreground color for Tooltips to #000000

And restart Eclipse after that.

57 comments hidden view all 108 comments
In , Zssun (zssun) wrote :

Hi Praveen:
  I tested the snippet again in new version of eclipse(Version: 3.5.2
Build id: 20100218-1602).I found the problem still exist. In addition,I found the tooltip works well when using other themes(except "Appearance") of Ubuntu. Seems, that the text color for tooltips defined in OS theme is not recognized by SWT(theme "Appearance" defines for tooltips a black background and white text -> if you change the background color to yellow, the tooltip in ToolTip will be yellow with black text color),I think it should be caused by ToopTip does not inherit the text color of the Ambiance Theme.The text color is always "black", so if some theme(like "Ambiance", default of Ubuntu10.04) set the backcolor as black, we can not see text on tooltip any way.

56 comments hidden view all 108 comments
Alexey Kotlyarov (koterpillar) wrote :

Isn't it Eclipse's fault to draw tooltip text black, when it should be white as per theme?

Alexey Kotlyarov (koterpillar) wrote :

For non-C development, there are other files setting it:
alex@flower2:~/projects/.metadata$ find . -name *.prefs | xargs grep sourceHoverBackgroundColor
./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs:sourceHoverBackgroundColor=245,245,181
./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs:sourceHoverBackgroundColor.SystemDefault=false
./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.dltk.ruby.ui.prefs:sourceHoverBackgroundColor=0,0,0
./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.dltk.ruby.ui.prefs:sourceHoverBackgroundColor.SystemDefault=true
./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.dltk.ui.prefs:sourceHoverBackgroundColor.SystemDefault=true
./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.dltk.ui.prefs:sourceHoverBackgroundColor=0,0,0

And the last two (Ruby and DLTK) get reset after shutting down Eclipse, even though I've set it to the same as CDT.

Vincenzo Pii (vinc-pii) wrote :

I can confirm this bug, and want to thank Slug (comment #7) for that not-intrusive workaround that solved the issue without changing the whole system aspect settings!

Philipp Wendler (philw85) wrote :

This bug should definitely be fixed. While the normal text on the tooltip was white for me and there readable (although very ugly IMO), additional content of the tooltip like icons and especially links are not visible well (see attachment). Changing the tooltip colors of the theme works for me. In my opinion, the tooltips of a light theme should not be black anyway but yellow like the users are accustomed to.

54 comments hidden view all 108 comments

I can confirm this bug on Ubuntu Lucid Lynx with Eclipse 3.5.2 (M20100211-1343).

53 comments hidden view all 108 comments
Damien Lecan (dlecan) wrote :

Duplicates bug #572209 ?

cfriedt (chrisfriedt) wrote :

In reply to comment #12

It is not eclipse's fault, per se. Eclipse uses several different text colours according to the syntax highlighting of the editor being used. If it were eclipse's "fault", then Eclipse would be responsible to check every single possible conflict of colours and dynamically re-configure the theme, which is completely ridiculous, and invalidates the entire point of eclipse managing its own syntax highlighting.

It should actually be gtk's responsibility to recognize when applications specify custom text colours / themes. In those cases, gtk should _not_ apply the default text colour / font / etc, but rather those specified by the application. Only when an application does not specify custom text colours / fonts / etc, should gtk resort to the default text colour / font / etc.

It is Eclipse's fault IMHO. GTK theme specifies that:
- editor text should be drawn using background color A and foreground
color B.
- tooltips should be drawn using background color C and foreground color
D.
It guarantees that A and B, as well as C and D, are distinguishable.

Eclipse makes an incorrect assumption that if it mixes all the colors
together, D will be fine on A.

GTK can do nothing to prevent Eclipse from using the theme's colors (see
http://bugs.launchpad.net/bugs/554600 for another example).

52 comments hidden view all 108 comments

Created attachment 167428
proposed patch

Please review this patch.

Thanks,
Hiro

51 comments hidden view all 108 comments
Charles Kozler (ckozleriii) wrote :

I can confirm this too. Also, I do not think this is specific to just eclipse and may be a more higher level thing as Pidgin reacts the same way:

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

Charles Kozler (ckozleriii) wrote :

Comment #9 worked properly. I am using Eclipse's PHP editor and the suggestions above did not work. Also, editing the theme "tooltips" color selection from black to white fixed hte issue pidgin as well.

Vinay Pai (vinay.pai) wrote :

I'm editing using PHP mode. When I set the sourceHoverBackgroundColor property in org.eclipse.dltk.ui.prefs it sometimes works right after I restart eclipse then reverts to black, and gets set back to 0,0,0 in the file. #9 worked for me for now though.

wdesmet (kromagg) wrote :

I'd just like to add that a secondary problem is the javadoc display. This also uses a black background, with white text. The problem being that links are using dark blue, which is unreadable on pure black.

48 comments hidden view all 108 comments

Praveen, do you have Ubuntu 10.04 ?
Does the problem really happen there ?
does the fix work ?

(In reply to comment #5)
> Praveen, do you have Ubuntu 10.04 ?
I do not have a Ubuntu 10.04 machine to reproduce the reported problem. However, I'm sure that this does not until Ubuntu9.10. I am trying to get the 10.04 installable, and will try to reproduce it after that.

Created attachment 168053
updated patch

Here is my updated proposed patch.

Thanks,
Hiro

Created attachment 168056
Screenshot - Black bubble ToolTip on Snippet225

This is a screenshot which shows black bubble Tooltip displayed on Snippet225.

OS: Ubuntu 10.04 LTS
GTK2: 2.20.0-0ubuntu4

50 comments hidden view all 108 comments

Confirm #22 - I also can achieve a temporary fix, but it does seem to revert when I change the file I'm editing.
The only permanent solution is the Workaround that is #9 (i.e. changing default colour scheme for tooltips).

51 comments hidden view all 108 comments

silenio, do you have ubuntu 10.04 ?

Yes, the patch is good. We should consider this for 3.6 RC2

Right, in ToolTip#createHandle() we set the background of the window to COLOR_INFO_BACKGROUND, so it does make sense to set the foreground of the PangoLayouts to COLOR_INFO_FOREGROUND.

But I don't think gtk_expose_event is the right place, the foreground should be set in setText() and setMessage() where the layout was created and initialized.

(In reply to comment #11)
> But I don't think gtk_expose_event is the right place, the foreground should be
> set in setText() and setMessage() where the layout was created and initialized.

I tried calling gtk_widget_modify_fg() with the text/message color in setText() and setMessage(), but it rendered black text/message, so did not work.

So, that's why Im usng gdk_gc_setforeground().
gdk_gc_set_foreground() needs a GdkGC. So I don't think we can call it in setText() and in setMessage(). But I think we can call display.getSystemColor() in setText() and in setMessage() at least.
I will update the patch soon.

Thanks,
Hro

Created attachment 168411
another patch

I modified a patch in comment #7 slightly. This patch calls display.getSystemColor() in setMessage() and in setText() and remembers it, and set it in gtk_expose_event().

Actually ExpandBar widget is doing the same as a patch in comment #7. So, either this patch or the patch in comment #7 would be ok for me.

Thanks,
Hiro

I see, the patch is setting the color in the GC, that is fine.
I read it too fast and I thought the color was being set in the pangolayout.

*** Bug 309334 has been marked as a duplicate of this bug. ***

*** Bug 312966 has been marked as a duplicate of this bug. ***

Please review the the patch in comment 7.

The info color background in ubuntu is black (and foreground is white).
Currently the code only sets the background of the tooltip to info background (==black), but it leaves the default foregorund set (also black).

I have the testcase set in SSQ's machine if you need a demo.

Note: the emulated tooltip has the same problem (not setting the foreground), but the problem will never be seeing because the platforms using the emulated tooltip (motif/carbon/cocoa) hardcode the color for info background and foreground(always black on yellow).

Fixed in HEAD > 20100517

Thank you for the patch

60 comments hidden view all 108 comments
BigBadBassMan (d-reiche) wrote :

in reply to #18:

This has absolutely nothing to do with eclipse!
If an application developer wants to use custom fg and bg colors, he/she will have a reason to do so, rather than using the system defined ones. (And if it is simply, because he/she wants his/her app to look the same, no matter what theme/distro is used, that should also be respected!)

In such a case, the gtk has to repsect the applications settings, rather than enforcing some system defined defaults!
Maybe there is not function in gtk te let an application tell the toolkit to use the default colors? That is not a fault of Eclispe either. If an application specifies colors, those should be respected, not overriden!
Also, the whole mess with GDK_NATIVE_WINDOWS is ridiculous. Why isn't the some sort of compatibility API, if the developers decide to change the API between minor releases?
I had to set this flag for flash too, because some flash apps where not usable. And it took ages to find out that it was GDK not flash that was faulty, and where to apply the fix...

Alexey Kotlyarov (koterpillar) wrote :

Eclipse *can* override all colors (see comment #7), but only for C. And
the problem is, by default it overrides the foreground color but not the
background, therefore the mess.

So a solution will be to either respect all theme colors, or none (and
end up with something like the notebook crapware:
http://www.fcenter.ru/img/article/notebooks/Lenovo_IdeaPad_Y550P/152311.jpg)

BigBadBassMan (d-reiche) wrote :

nope, this happens also for the PHP and JAVA flavours of Eclipse.
besides that, changing the theme to something other than Ambiance or Radiance solves the problem.

So, is it a bad theme-ing decision to use dark backgrounds,
or the eclispe folks, who have not considered that the backgroundcolor may be dark, and forgot to set the foreground color explicitely?

Anyway, it is not user friendly, to tell folks to use a different theme, when their most used application is barely usable.

The problem with manually changing the colors is: eclipse may work, but you break tooltips in other apps!
For me, eclipse showed TTs with black text on light background, whereas Firefox tried to render background and text of Tooltips in light colors - same as above but the other way around. Only reason was to switch to a different theme.

Alexey Kotlyarov (koterpillar) wrote :

> nope, this happens also for the PHP and JAVA flavours of Eclipse.
And Ruby, but for all those the fix from #7 does not work.

> For me, eclipse showed TTs with black text on light background,
> whereas Firefox tried to render background and text of Tooltips in
> light colors - same as above but the other way around. Only reason
> was to switch to a different theme.
I have changed the tooltips to be dark on light, this works everywhere.

Vadim Dmitriev (dmgloss) wrote :

Fixed in latest eclipse 3.6 RC2: https://bugs.eclipse.org/309907

57 comments hidden view all 108 comments

*** Bug 314384 has been marked as a duplicate of this bug. ***

56 comments hidden view all 108 comments
NormInNorman (nsmelton) wrote :

I had the same problem as BigBadBassMan. Unfortunately I'm using ZendStudio so I can't update to Eclipse 3.6 until Zend does. My fix was to change tooltips to text=black and blackgorund=#808080, which is halfway between black and white. Now in both Zend Studio AND Firefox I can read the tooltips. To me it looks bad, but at least I can use it.

Niels Thykier (niels-thykier) wrote :

Vadim Dmitriev wrote:
> Fixed in latest eclipse 3.6 RC2: https://bugs.eclipse.org/309907
>

Hi

I have tried to backport this to the eclipse in Ubuntu and have uploaded
modified versions of eclipse to the team PPA[1].

If you decide to test if this patch work, please remember to test with a
"clean" eclipse (rename ~/.eclipse and create a new workspace for the
test). This is especially true for all of who have deployed a workaround.

~Niels

[1] https://launchpad.net/~eclipse-team/+archive/debian-package

Tried the 3.6RC2 of Eclipse and the problem is _not_ fixed.

55 comments hidden view all 108 comments

Just tried Eclipse 3.6RC2 on Ubuntu Lucid Lynx (64bits) and still having the problem using a new profile (deleted the .eclipse folder) and a new workspace.
I did not try any workaround in the past, so you could consider my install "clean".

54 comments hidden view all 108 comments
Niels Thykier (niels-thykier) wrote :

Michele Costantino Soccio wrote:
> Tried the 3.6RC2 of Eclipse and the problem is _not_ fixed.
>

Hi

If you downloaded that 3.6RC2 from eclipse.org, then please report your
result directly to the upstream bug so they are aware of it and can
revise their solution. There is a link to it in this report.

~Niels

NB: Just for clarification, the packages I uploaded to the PPA mentioned
in my previous post is a patched 3.5.2 and not 3.6 - if you used those,
please test the 3.6RC2 from eclipse.org before posting on the upstreams
bug tracker.

55 comments hidden view all 108 comments

Issue is not fixed for me too with Eclipse 3.6RC2 on Ubuntu 10.04.

.eclipse folder was deleted and I was using a fresh workspace.

Michele, Damien, could you please attach screenshots so that it's clear which tooltip you refer to? Thanks!

My comment wasn't true, it's working perfectly.

For me, the bug still exists in Eclipse 3.6 RC3 : following deletion of the .eclipse folder and using an new workspace, in the C++ editor, the popups that show up when hovering over any c++ object in the editor are always black background and normal colored text (which often means black text). I'm running Eclipse on Ubuntu 10.04 with the default 'Ambiance' theme.

Created attachment 171148
Pop-up tooltip with black text & background

This image shows how a dark gtk theme can render Eclipse pop-ups useless.

Martin, you are seeing a variant of bug 312966 which was filed against JDT. This bug (at the SWT level) has indeed been fixed, but we have these other cases that result in similar black-text-on-black-background situations. You should probably file a new bug against CDT (and reference the existing bugs for context) to make them aware of the problem.

As a workaround, you could try to set a different "Source hover background" color, for the Java editor that's under Preferences > Java > Editor. I hope CDT has an equivalent preference page for their editors.

59 comments hidden view all 108 comments
Alexey Kotlyarov (koterpillar) wrote :

The PPA package fixed Javadoc and Java tooltips, but changed nothing for Ruby (DLTK).

Benjamin Drung (bdrung) on 2010-06-05
Changed in eclipse (Ubuntu):
status: New → Triaged
Benjamin Drung (bdrung) on 2010-06-05
Changed in eclipse (Ubuntu):
importance: Undecided → Low
Niels Thykier (niels-thykier) wrote :

@Alexey Kotlyarov

Hi

We recently uploaded a new package to the PPA with another patch; does that fix the Ruby/DLTK issue? If not then we need to forward this issue upstream.

~Niels

Changed in eclipse (Ubuntu):
status: Triaged → Incomplete
Alexey Kotlyarov (koterpillar) wrote :

Pardon, where is the package? I don't see any updates on https://launchpad.net/~eclipse-team/+archive/debian-package...

Changeing tooltips color in Apereance corects that.
Maybe themes would be updated soon, not such a killer bug, maybe would be ok to duplicate themes with different tooltips colors.
same for community themes.

Niels Thykier (niels-thykier) wrote :

Hi

We have committed the two patches and they will be a part of the new upload.

@Alexey Kotlyarov

The "new" packages are the ones uploaded on "2010-06-05" (I uploaded a few days before I posted here). I suspect that the second patch will not fix the Ruby/DLTK issue and we will have to file a bug against it upstream.

~Niels

Changed in eclipse (Ubuntu):
status: Incomplete → Fix Committed
jollyr0ger (jollyr0ger) wrote :

Where we'll can downdload that package? Tnx

Niels Thykier (niels-thykier) wrote :

Hi

You can either fetch it from the PPA at [1] or wait for us to upload it. For the Maverick release, it will probably be stalled until after the weekend.

For Lucid (10.04) there is no more changes expected; we may be able to get that uploaded already tomorrow.

~Niels

[1] https://launchpad.net/~eclipse-team/+archive/debian-package

Benjamin Drung (bdrung) on 2010-06-24
Changed in eclipse (Ubuntu Lucid):
status: New → Fix Committed
Martin Pitt (pitti) on 2010-06-25
tags: added: verification-needed
Changed in eclipse (Ubuntu):
status: Fix Committed → Fix Released
54 comments hidden view all 108 comments

*** Bug 318964 has been marked as a duplicate of this bug. ***

Martin Pitt (pitti) on 2010-07-28
Changed in light-themes (Ubuntu):
status: Confirmed → Invalid
Changed in light-themes (Ubuntu Lucid):
status: New → Invalid
tags: added: verification-done
removed: verification-needed
Changed in eclipse (Ubuntu Lucid):
status: Fix Committed → Fix Released

Created attachment 175866
patch for 3.5.2

Created attachment 175869
patch for 3.4.2

In , Raji-2 (raji-2) wrote :

Can this be included in 3.6.1?

(In reply to comment #31)
> Can this be included in 3.6.1?

No need, this bug was fixed in 3.6 RC2

Thanks for the clarification!

If you're still seeing this on Ubuntu 10.04 and Eclipse 3.6: Check the System > Preferences > Appearance > Theme > Colours > tooltip setting. The default color scheme of the 'Radiance' theme for tooltips is white text on black background (which came unexpected to me given that Radiance is a very light theme)

Hi, I am still having this problem.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=365051
Okay, it's corregible through the options, but the bug should not be market as fixed becase if you do a fresh install of Version: 3.7.1 Build id: R3_7_1 you will still have it.

*** Bug 365051 has been marked as a duplicate of this bug. ***

(In reply to comment #35)
> Hi, I am still having this problem.
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=365051
> Okay, it's corregible through the options, but the bug should not be market as
> fixed becase if you do a fresh install of Version: 3.7.1 Build id: R3_7_1 you
> will still have it.

See comment 26, 27, and 28. I suggest you open a new bug against CDT.

(In reply to comment #37)
> See comment 26, 27, and 28. I suggest you open a new bug against CDT.

That should be comment 25, comment 26, and comment 27.

I've reopened my previous bugreport as CDT bug

This problem re-appeared with GTK3. There is a description and screenshot here: https://github.com/syncany/syncany/issues/339

It can be reproduced with this code:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet225.java

Tested systems:
- Linux Mint 17
- Arch Linux
- Both SWT 4.4 (without SWT_GTK3=0)

By setting SWT_GTK3=0, the tooltip/bubble has the correct color.

Created attachment 249850
Reproduced with SWT 4.4

Changed in light-themes:
importance: Unknown → Medium
status: Unknown → Fix Released
Displaying first 40 and last 40 comments. View all 108 comments or add a comment.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

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