Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 275589 - can't see text cursor after setting dark background color
Summary: can't see text cursor after setting dark background color
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: Macintosh Mac OS X
: P3 normal with 5 votes (vote)
Target Milestone: 3.5.1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 276540 282539 283261 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-11 00:29 EDT by Pete Siemsen CLA
Modified: 2012-03-29 16:32 EDT (History)
15 users (show)

See Also:


Attachments
fix (9.58 KB, patch)
2009-06-11 10:11 EDT, Silenio Quarti CLA
no flags Details | Diff
screen capture (734.40 KB, video/quicktime)
2012-03-29 13:15 EDT, Silenio Quarti CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pete Siemsen CLA 2009-05-11 00:29:34 EDT
3.5M7, Build ID: I20090430-2300

Steps To Reproduce:
1. set the background to a dark color and the forground to a light color

More information:
I tune my preferences so that my backgrounds are dark and my
foregrounds are light - I don't like staring into a light all
day.  It's a pain to change all the Eclipse preferences to make
this work, but I've done it.

I can't find preferences that control the color of the text 
cursor or the mouse cursor, so they disappear or are hard to see.
The text color seems to blink between my background color and
black, so it disappears completely if my background is black.
The mouse cursor (shaped like an I-beam) seems to be dark grey,
so it's barely visible.

Perhaps there are preferences that control this, but I couldn't
find them.
Comment 1 Dani Megert CLA 2009-05-11 03:21:50 EDT
The caret color is controlled by the OS and there's no Eclipse preference for it. Please change it at the OS level.
Comment 2 Pete Siemsen CLA 2009-05-11 11:13:43 EDT
(In reply to comment #1)
> The caret color is controlled by the OS and there's no Eclipse preference for
> it. Please change it at the OS level.

Ok, but the text cursor isn't controlled by the OS.  Not seeing it is the more bothersome of the two problems.
Comment 3 Dani Megert CLA 2009-05-11 11:15:55 EDT
This is the same issue. You need to control it at the OS level.
Comment 4 Pete Siemsen CLA 2009-05-11 15:46:09 EDT
(In reply to comment #3)
> This is the same issue. You need to control it at the OS level.

It is *NOT* the same issue.  The OS may control the mouse cursor, but the text cursor is application-specific.  That's why the Mac's Terminal application and xterm control the text cursor with application-specific preferences.  Eclipse controls the text cursor color, it just doesn't allow the user to set the color.

I came across other posts that mentioned that Eclipse's text cursor is supposed to be displayed blinking the reverse color of the "current line highlight" color.  That may be how it works under Windows.  If Eclipse did that, it would be reasonable to not to provide a preference setting.  As it stands now, anyone who uses the new Eclipse Cocoa on a Mac with a dark background is screwed.

It's kinda important to be able to see where you are in an editor window :-)
Comment 5 Markus Keller CLA 2009-05-11 19:42:54 EDT
Moving to SWT. Same issue in Text and Combo widgets.
Comment 6 Felipe Heidrich CLA 2009-05-12 11:20:02 EDT
Do you use carbon or cocoa ?
Comment 7 Markus Keller CLA 2009-05-12 11:40:38 EDT
Pete said "Eclipse Cocoa on a Mac" and I also used Cocoa (I20090508-2000).
Fixing OS field and adjusting summary.
Comment 8 Dani Megert CLA 2009-05-16 07:42:52 EDT
*** Bug 276540 has been marked as a duplicate of this bug. ***
Comment 9 Keith Wedinger CLA 2009-05-26 09:29:14 EDT
I downloaded and installed the RC2 build of the Eclipse SDK from http://download.eclipse.org/eclipse/downloads/drops/S-3.5RC2-200905221710/index.php and this issue is still present in this build.  Unlike other builds of Galileo, the Mac OS X Cocoa build does not set the text cursor color to the inverse of the Current Line Highlight color.  This makes the cursor invisible when the current line highlight color is set to a dark color.

Please note too that this issue represents a regression from Eclipse Ganymede.
Comment 10 Keith Wedinger CLA 2009-06-11 08:42:16 EDT
This issue still exists in the RC3 build of Galileo.  This issue prevents the use of dark background colors on Mac OS X because the text cursor becomes effectively hidden.

Please note that as far as I can tell, there is no way inside Mac OS X to set the text cursor color.
Comment 11 Silenio Quarti CLA 2009-06-11 10:11:37 EDT
Created attachment 138932 [details]
fix
Comment 12 Keith Wedinger CLA 2009-06-11 10:52:03 EDT
(In reply to comment #11)
> Created an attachment (id=138932) [details]
> fix
> 

I would be happy to test this fix when the fix is available in a build.  When the fix is available, post a link to the build and I will download and test it.
Comment 13 Keith Wedinger CLA 2009-06-24 12:27:58 EDT
I tested this with the Galileo release that came out today and discovered that this is still an issue with the Max OS X Cocoa release of Eclipse.  Please note that due to my color configuration, this bug makes the Cocoa release of Eclipse unusable (the text editor cursor is effectively invisible).  I will continue to use the Carbin release until this bug is fixed.
Comment 14 elan feingold CLA 2009-06-24 22:24:35 EDT
I'm having the same issue, would love to see this fixed.
Comment 15 Silenio Quarti CLA 2009-06-25 09:51:35 EDT
I see two ways of working around this problem. Keep the "Highlight Current Line" check box in the preferences page set (General -> Editors -> Text Editors) and use a light color for the caret line. Or turn off the "Smart Insert Mode" in the Edit menu bar for the JDT editor (this will give a caret that works in dark backgrounds).

I am marking this to be fixed in 3.5.1.
Comment 16 Silenio Quarti CLA 2009-07-07 17:50:41 EDT
Fixed > 20090707 (only in HEAD for now)
Comment 17 Ari Gordon-Schlosberg CLA 2009-07-12 20:24:21 EDT
*** Bug 283261 has been marked as a duplicate of this bug. ***
Comment 18 Silenio Quarti CLA 2009-07-14 15:43:43 EDT
Fixed in 3.5.x as well.
Comment 19 Silenio Quarti CLA 2009-07-18 00:19:41 EDT
*** Bug 282539 has been marked as a duplicate of this bug. ***
Comment 20 Pete Siemsen CLA 2009-07-29 17:32:35 EDT
This is *NOT* fixed.  Neither of the suggested "workarounds" work.

The first suggested workaround was

  "Keep the "Highlight Current Line" check box in the preferences page set (General -> Editors -> Text
Editors) and use a light color for the caret line."

This is useless.  When the preferences have been set up for light characters on a dark background, the characters are obviously displayed with light colors.  If you then set the "Current Line highlight" to a light color, Eclipse uses that color as the background color of the current line.  The current line is displayed with light characters on a light background, which is unreadable.

The second suggested workaround was

  "turn off the "Smart Insert Mode" in the Edit menu bar for the JDT editor"

This made the problem worse.  Instead of a nearly invisible black cursor on a dark background, the cursor disappears entirely, so you have even less ability to see "where you are".  Also, this "solution" applies only to the JDT editor, and won't help users who edit Python, HTML or other kinds of files.

This is not a simple matter of finding preferences to set.  It's a fundamental problem with display of the cursor.
Comment 21 Scott Kovatch CLA 2009-07-29 17:41:24 EDT
(In reply to comment #20)
> This is *NOT* fixed.  Neither of the suggested "workarounds" work.

Have you tried a nightly build (see comment #16) in the 3.6 or 3.5.1 stream? Silenio's comment #15 was indicating that it would be fixed in 3.5.1 as well as 3.6, and not that the workarounds suggested were the actual fix.
Comment 22 Pete Siemsen CLA 2009-07-30 19:19:17 EDT
I downloaded 3.5.1 (eclipse-SDK-M20090729-0903-macosx-cocoa.tar) and the problem is indeed fixed.

Thank you very, very much!
Comment 23 vpiket CLA 2011-03-30 20:12:25 EDT
(In reply to comment #22)
> I downloaded 3.5.1 (eclipse-SDK-M20090729-0903-macosx-cocoa.tar) and the
> problem is indeed fixed.
> 
> Thank you very, very much!


I've tried this in 3.6.5.0 and it seems the bug has crept back?
Comment 24 vpiket CLA 2011-03-30 20:18:55 EDT
Example code to reproduce the problem:

public class TableShellExample {

	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setSize(200, 100);

		Text text = new Text(shell, SWT.NONE);
		text.setVisible(true);
		text.setBounds(0, 0, 100, 30);
		text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
		text.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));

		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}
Comment 25 Silenio Quarti CLA 2011-03-31 16:38:54 EDT
This bug report is for StyledText (the widget used for the Java editor in Eclipse) which I confirmed still works in latest.

Your problem is in the native Text widget. Please open a separate bug report. Note that I believe this is a limitation in cocoa and I am not sure there is anything SWT can do to fix it. The problem also happens in TextEdit.app.
Comment 26 Basil Bourque CLA 2012-03-03 18:42:18 EST
No, the bug seems to continue. 

Under either the Wombat or Zenburn themes, the mouse pointer is virtually invisible against the dark background of the Java code editor.

Also, the comment about this happening under TextEdit.app makes no sense, as there is no way I know of to get a dark background in TextEdit.
Comment 27 Basil Bourque CLA 2012-03-03 18:44:23 EST
Whoops, on my comment made a moment ago, I should had mentioned:

Mac OS X 10.7.3 on MacBook unibody.

Eclipse Java EE IDE for Web Developers.

Version: Indigo Service Release 2
Build id: 20120216-1857

But the problem was also present with 10.7.2 and recent versions of Eclipse.

--Basil Bourque
Comment 28 Carlo Bertoldi CLA 2012-03-08 04:12:16 EST
(In reply to comment #26)
> No, the bug seems to continue. 
> 
> Under either the Wombat or Zenburn themes, the mouse pointer is virtually
> invisible against the dark background of the Java code editor.
> 
> Also, the comment about this happening under TextEdit.app makes no sense, as
> there is no way I know of to get a dark background in TextEdit.

I prefer dark background too, so I'm affected by this.
But Silenio Quarti is right: I changed the background in TextEdit, http://www.macosxtips.co.uk/index_files/set-background-colour-in-textedit.php
and the cursor is almost invisible just like in Eclipse.

 Carlo
Comment 29 Carlo Bertoldi CLA 2012-03-08 04:25:57 EST
(In reply to comment #28)
> (In reply to comment #26)
> > No, the bug seems to continue. 
> > 
> > Under either the Wombat or Zenburn themes, the mouse pointer is virtually
> > invisible against the dark background of the Java code editor.
> > 
> > Also, the comment about this happening under TextEdit.app makes no sense, as
> > there is no way I know of to get a dark background in TextEdit.
> 
> I prefer dark background too, so I'm affected by this.
> But Silenio Quarti is right: I changed the background in TextEdit,
> http://www.macosxtips.co.uk/index_files/set-background-colour-in-textedit.php
> and the cursor is almost invisible just like in Eclipse.
> 
>  Carlo

I forgot to mention that I use iTerm2, obviously with a dark background, but the text cursor is visible. It seem that iTerm adds to the cursor a white contour to make it visible again.
Comment 30 Philip Schlesinger CLA 2012-03-27 16:55:40 EDT
THIS IS NOT FIXED; VERIFY FAIL.

I have the same configuration as Basil Bourque and I am having this same issue.  There's a white 3D shading on the left side of the i-bar in OS X Terminal which makes it visible on a black background.  The Eclipse i-bar is a flat cursor which is only black.
Comment 31 Silenio Quarti CLA 2012-03-29 13:15:55 EDT
Created attachment 213343 [details]
screen capture

Just tried this in latest 4.2 build (I20120321-0610) and works fine to me. See attached movie. The caret blinks with a light colour over the dark background.

Please could you be more specific as to what is broken for you?
Comment 32 Philip Schlesinger CLA 2012-03-29 14:49:24 EDT
Hi Silenio, my text insert cursor is fine, but the i-beam mouse cursor disappears in the background if the background is black.  The same issue does not occur in OS X Terminal as it has that white shading on the left side of the i-beam.  Check out this video of the problem: 

http://www.flickr.com/photos/29352617@N00/7027417937/

I'll try embedding it:

<object type="application/x-shockwave-flash" width="" height="" data="http://www.flickr.com/apps/video/stewart.swf?v=109786" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param name="flashvars" value="intl_lang=en-us&photo_secret=&photo_id=7027417937"></param> <param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=109786"></param> <param name="bgcolor" value="#000000"></param> <param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=109786" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&photo_secret=&photo_id=7027417937" height="" width=""></embed></object>
Comment 33 Philip Schlesinger CLA 2012-03-29 14:52:57 EDT
And just to note, this ticket was opened with the following description mentioning issues with both the text AND mouse cursors (emphasis added):

I can't find preferences that control the color of the text 
cursor or the MOUSE CURSOR, so they disappear or are hard to see.
The text color seems to blink between my background color and
black, so it disappears completely if my background is black.
The MOUSE CURSOR (shaped like an I-beam) seems to be dark grey,
so it's barely visible.
Comment 34 Silenio Quarti CLA 2012-03-29 15:13:06 EDT
The mouse cursor problem has been fixed in 3.8/4.2  (see bug#358022). The I-beam cursor has a white shadow to the left. Please try the latest.
Comment 35 Philip Schlesinger CLA 2012-03-29 15:28:55 EDT
Hi Silenio -- where do I find the download page for 3.8?  Normal downloads are for 3.7.2, developer builds are for 4.2 M6.
Comment 36 Silenio Quarti CLA 2012-03-29 15:40:38 EDT
In http://www.eclipse.org/downloads/ click "Other Downloads"

It should take you to:

http://download.eclipse.org/eclipse/downloads/

which has 4.2 builds. Them follow "Eclipse 3.x downloads are here." to

http://download.eclipse.org/eclipse/downloads/eclipse3x.php
Comment 37 Philip Schlesinger CLA 2012-03-29 16:32:35 EDT
Excellent -- thanks! :)