Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329720

Summary: [hover] There is no preference to change background color of debug hover popup
Product: [Eclipse Project] JDT Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: DebugAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aleherb+eclipse, cdtdoug, chris.bainbridge, daniel_megert, friesoft, markus.kell.r, Michael_Rennie, pawel.1.piech
Version: 3.6   
Target Milestone: 4.3 M2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 361373    
Bug Blocks:    
Attachments:
Description Flags
Screenshot of high-contrast theme. none

Description Sergey Prigogin CLA 2010-11-08 21:43:48 EST
The background color of the debug hover popup on Linux Lucid Lynx is inherited from the desktop theme. For dark color schemes this leads to black text on a dark grey background. There should be a preference for setting background color of debug hover popup within Eclipse independently from the desktop theme.
Comment 1 Pawel Piech CLA 2010-11-09 23:29:33 EST
Hi Sergey,
The debug hover is implemented in CDT, and it's different for CDT and DSF.  Could you specify which debugger are you using?
Comment 2 Sergey Prigogin CLA 2010-11-09 23:43:29 EST
(In reply to comment #1)

I saw the dark grey background in CDT 6.0.2 with CDI GDB, but the preference for setting background color or the hover is missing even in CDT 8.0 with DSF GDB.
Comment 3 Pawel Piech CLA 2010-11-10 00:50:05 EST
I'm guessing that it's code that got cut-and-pasted over and over... 

Toni, do you know off top of your head whether this is something common or specific to each debugger?
Comment 4 Anton Leherbauer CLA 2010-11-10 09:04:25 EST
The code is basically cloned from JDT, but AFAIK they don't have a preference for the debug hover color either.
Comment 5 Sergey Prigogin CLA 2010-11-10 14:53:46 EST
(In reply to comment #4)
That's why the bug was originally filed against Platform, which should provide this preferences to be used by all debuggers.
Comment 6 Pawel Piech CLA 2010-11-10 17:42:14 EST
Created attachment 182856 [details]
Screenshot of high-contrast theme.

I tried to reproduce the problem (on Lucid Lynx), but it actually worked fine for me (see screenshot).  I also tried the simple hover (not the one in screenshot) and that worked too.  

As far as a color preference, I'm fine with it in Platform if it's used by JDT and CDT.  In this case though, it seems that the problem would be more that the hover uses a mix of system colors and preference colors, rather than consistently using one or the other.
Comment 7 Dani Megert CLA 2012-05-04 04:03:14 EDT
*** Bug 378394 has been marked as a duplicate of this bug. ***
Comment 8 Chris Bainbridge CLA 2012-05-04 04:37:20 EDT
Pawel, this can be reproduced with the simple test case in bug #378394. The results look like the jpg image here - https://bugs.eclipse.org/bugs/attachment.cgi?id=215015 

If you start a debugger session and hover over a class variable the popup will appear as black text on black background. Note that hovering over an int (like 'z' in the test case) works, but hover over a class declaration (like x2 in the test case) and eclipse shows a tree of the class which is black on black.
Comment 9 Markus Keller CLA 2012-05-04 06:26:17 EDT
I don't think the high-contrast theme will show this bug, since it changes everything to bright-on-dark. The problem on Ubuntu is that only the hover background color is dark, but the normal OS background color stays white (i.e. dark-on-bright OS, but bright-on-dark hovers).

The variable value hover mixes the hover background color with the OS foreground. We had a similar problem in the Java source hover, and we solved it with org.eclipse.jdt.internal.ui.text.java.hover.SourceViewerInformationControl#getVisibleBackgroundColor(Display).

In your case, you should try to use SWT.COLOR_INFO_BACKGROUND, but if it's too close to SWT.COLOR_LIST_FOREGROUND, then fall back to COLOR_LIST_BACKGROUND.
Comment 10 Markus Keller CLA 2012-09-17 15:00:47 EDT
This case is much simpler than bug 313943, since we don't have to deal with e.g. syntax colors. Here, we just need to make sure that we also set SWT.COLOR_INFO_FOREGROUND wherever we use SWT.COLOR_INFO_BACKGROUND.

Fixed with:
http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=80fe37bd7f52940f3f2f5e1186b6cb77161f285c

NOTE: The selected item will still look bad until the fix for bug 361373 gets released.

Filed bug 389753 for similar problems in Platform/Debug.
Comment 11 Michael Rennie CLA 2013-05-23 16:02:13 EDT
Verified in:

Version: 4.3.0
Build id: I20130521-2000

To verify on Windows:

1. go to personalize (from the desktop)
2. change to the windows classic theme
3. open the color and fonts customizer (click the theme at the bottom)
4. change the Tooltip font and background color