Bug 558782 - [regression] setting background color for text editor not applied with dark themes
Summary: [regression] setting background color for text editor not applied with dark t...
Status: CLOSED DUPLICATE of bug 559321
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.14   Edit
Hardware: All All
: P3 normal with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 577472 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-01-03 07:24 EST by Dave Null CLA
Modified: 2022-01-21 02:52 EST (History)
13 users (show)

See Also:


Attachments
broken preferences 1 (76.05 KB, image/jpeg)
2020-03-19 07:17 EDT, Martin Weiser CLA
no flags Details
broken preferences 2 (81.72 KB, image/jpeg)
2020-03-19 07:17 EDT, Martin Weiser CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Null CLA 2020-01-03 07:24:43 EST
Versions:
MacOS Catalina, 10.15.2
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)

Eclipse 2019-12, up to date as of 2020-01-03, 12:00 UTC; Build id: 20191212-1212; eclipse for java developers (though in place updated from 2019-09 (or possibly earlier))


Setting the background color for text editors (preferences > general > editors > text editors) only takes effect between the time one clicks apply, and closes the window. uppon closing the window, the gutter behind the line numbers remains the correct color, but the background of the text area returns to rgb(47,47,47), which occurs nowhere in my exported settings.epf. The background color in said settings.epf appears to be correct:

(assuming this is the correct line)
"/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Background=0,0,0"


Main appearance is set to dark[linux] but appeared to occur when set to "Dark" as well as "Dark [windows]" (asside: I previously started using "dark [linux]" because macOS detection from version to version occasionally removes the "dark" option.

Preferences recorder is disabled, so I cannot think of anything else that would suddenly change the appearance after closing the preferences window after applying the color.

This issue also occurs on build I20200101-1800.


Let me know if there is anything I can test or output/debug/log/etc I can provide to help.

Thanks.
Comment 1 Paul Pazderski CLA 2020-01-03 07:35:13 EST
Thanks for the detailed report Dave. Can reproduce on Windows 7. No problem in Light theme but the behavior you described in Dark theme. Using "Apply and close" has the same outcome.

@Lars you probably know some Dark Theme/CSS experts for this.
Comment 2 Martin Weiser CLA 2020-01-06 05:52:26 EST
I see exactly the same behaviour.
A few times the selected background color stayed even after closing the preferences window but then after any interaction with the editor window the grey background color immediately returns.
Comment 3 Lars Vogel CLA 2020-01-06 06:02:53 EST
We do set 'AbstractTextEditor.Color.Background=47,47,47' via e4-dark_preferencestyle.css but that has been the case since a long time. 

But user settings should have priority over CSS. I'm not aware of any change we did in the 2019-12 release in the CSS preference handling. 

In this release did this work?
Comment 4 Dave Null CLA 2020-01-06 12:18:49 EST
Can you clarify what you mean by 'In this release did this work?'?

Thanks
Comment 5 Lars Vogel CLA 2020-01-06 12:19:54 EST
(In reply to Dave Null from comment #4)
> Can you clarify what you mean by 'In this release did this work?'?
> 
> Thanks

Sorry, typo. 

You are saying this is a regression. So in which release did this work?
Comment 6 Dave Null CLA 2020-01-07 15:40:07 EST
Every release prior to and including 2019-09 as far as I'm aware. I was running 2019-09 prior to upgrading to 2019-12 with the 'dark[linux]' overall theme, and the abstract editor background set to 0,0,0. 

My editor background has always been black (0,0,0) since eclipse... io? 10+ years ago.

I have also used the "dark" UI chrome since it became an option a couple of years ago.

Thanks.
Comment 7 Dave Null CLA 2020-01-07 15:58:13 EST
On my laptop (which still has 2019-09), checked for updates to platform and 2019-09. MacOS 10.15.2, adoptopenjdk 1.8.0_232, eclipse build 20190917-1200.

Overall appearance theme: Dark [Linux]

set 

general > editors > text editors > background color to hot pink, 
then back to 0,0,0. works as expected.


Let me know if I can check anything else.

Thanks.
Comment 8 Dave Null CLA 2020-01-29 16:33:05 EST
Anything else I can test to move this along?
Comment 9 Martin Weiser CLA 2020-03-19 07:16:29 EDT
I just did a quick test with the newly released version 2020-03 and the bug is still there of course.
But now it seems that the preferences dialog also has issues since the settings "General->Editors->Text Editors" shows the list "Appearance color options" either with the text labels flipped horizontally (see picture 1) but still selectable, or as a thin line of garbage with nothing selectable (see picture 2).
Comment 10 Martin Weiser CLA 2020-03-19 07:17:16 EDT
Created attachment 282141 [details]
broken preferences 1
Comment 11 Martin Weiser CLA 2020-03-19 07:17:50 EDT
Created attachment 282142 [details]
broken preferences 2
Comment 12 Lars Vogel CLA 2020-03-19 07:26:21 EDT
(In reply to Martin Weiser from comment #9)
> I just did a quick test with the newly released version 2020-03 and the bug
> is still there of course.
> But now it seems that the preferences dialog also has issues since the
> settings "General->Editors->Text Editors" shows the list "Appearance color
> options" either with the text labels flipped horizontally (see picture 1)
> but still selectable, or as a thin line of garbage with nothing selectable
> (see picture 2).

Please open a new bug for that. Btw. I cannot produce on Linux.
Comment 13 Martin Weiser CLA 2020-03-19 07:40:15 EDT
(In reply to Lars Vogel from comment #12)
> (In reply to Martin Weiser from comment #9)
> > I just did a quick test with the newly released version 2020-03 and the bug
> > is still there of course.
> > But now it seems that the preferences dialog also has issues since the
> > settings "General->Editors->Text Editors" shows the list "Appearance color
> > options" either with the text labels flipped horizontally (see picture 1)
> > but still selectable, or as a thin line of garbage with nothing selectable
> > (see picture 2).
> 
> Please open a new bug for that. Btw. I cannot produce on Linux.

Someone else was faster: BUG 561235
Comment 14 Andrew Obuchowicz CLA 2020-05-19 10:03:54 EDT
I wonder if this is related to the change made in Bug 548057?

A list used to be used, which was changed to table (so that the color previews could be made visible from within the table).

Note that the change was made & tested on Linux only.
Comment 15 Derek Foster CLA 2020-09-22 19:57:04 EDT
This bug still exists as of the following Eclipse version:

Version: 2020-09 (4.17)
Build id: I20200902-1800


This is quite frustrating. Please fix this regression!

For the afflicted, some workarounds can be found here:

https://stackoverflow.com/questions/59599251/eclipse-2019-black-background

and here:

https://stackoverflow.com/questions/60450156/eclipse-4-14-0-changing-the-editor-background-colour
Comment 16 Derek Foster CLA 2020-09-22 20:10:29 EDT
Note that this bug report may be a duplicate of bug 559321.
Comment 17 Andrew Obuchowicz CLA 2020-09-23 00:26:29 EDT
This definetly needs to get fixed for 2020-12 as it is quite annoying.

I did some quick testing and it seems that the only the line number background gets modified when hitting apply and close on the text editor color preferences. I believe the actual text editor background gets overriden by the theme's CSS.

My argument is based on the following workaround which was suggested, which involves modifying eclipse's dark CSS to change the editor background: 

> 
> For the afflicted, some workarounds can be found here:
> 
> https://stackoverflow.com/questions/59599251/eclipse-2019-black-background

In Spectrum Theme (which was originally based on the Platform Dark Theme), we have similar CSS and it also takes precedence over the editor background color (so the bug exists for Spectrum Theme as well). https://github.com/AObuchow/Eclipse-Spectrum-Theme/blob/master/com.aobuchow.themes.spectrum/css/default_overrides.css#L280



I wonder what change caused this bug: 
- was it a change in the CSS? (eg. the CSS mentioned in the workaround was added in)
- was it a change in the CSS handler? (eg. CSS mistakenly takes priority over preferences)
- something else?
Comment 18 Andrew Obuchowicz CLA 2020-09-23 01:12:30 EDT
> 
> I wonder what change caused this bug: 
> - was it a change in the CSS? (eg. the CSS mentioned in the workaround was
> added in)


So I reverted some CSS patches made before 2020-09 and I think the bug is coming from https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/152281/ as the commit before this change does not have this bug.

I can see

.MPart Composite > *,
.MPart Composite > * > *,

was added to the e4 dark part style, this is probably overriding the text editors preferences.

I might be mistaken though, it's late and I have to go to bed :)
Comment 19 Derek Foster CLA 2021-12-09 22:01:59 EST
I am still seeing this problem on Eclipse 4.22:

Version: 2021-12 (4.22)
Build id: I20211124-1800
OS: Windows 10, v.10.0, x86_64 / win32

I would love for this to be fixed so that I don't have to manually modify obscure config files each time I upgrade eclipse! Please fix this!
Comment 20 Eclipse Genie CLA 2021-12-16 11:48:27 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/188920
Comment 21 Mickael Istria CLA 2021-12-16 12:28:29 EST
*** Bug 577472 has been marked as a duplicate of this bug. ***
Comment 22 Rolf Theunissen CLA 2022-01-21 02:52:59 EST

*** This bug has been marked as a duplicate of bug 559321 ***