Bug 567563 - [Win32] Eclipse could set dark mode based on OS settings.
Summary: [Win32] Eclipse could set dark mode based on OS settings.
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.18   Edit
Hardware: PC Windows All
: P3 enhancement (vote)
Target Milestone: 4.24 M1   Edit
Assignee: Niraj Modi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 579223
  Show dependency tree
 
Reported: 2020-10-03 07:19 EDT by Marek Andreansky CLA
Modified: 2022-06-24 12:45 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Andreansky CLA 2020-10-03 07:19:07 EDT

    
Comment 1 Andrew Obuchowicz CLA 2020-10-03 13:00:23 EDT
IIRC this was implemented already for Mac & Linux (GTK) but I don't think it's supported on Windows yet.
Comment 2 Marek Andreansky CLA 2020-10-03 13:30:04 EDT
(In reply to Andrew Obuchowicz from comment #1)
> IIRC this was implemented already for Mac & Linux (GTK) but I don't think
> it's supported on Windows yet.

Thanks, I am using Windows and have tagged Windows, mentioned the other platforms as I did not know those already had it.

The use case is that every time a new workspace is created it uses the light theme. Since there is no way to set up a global profile (or override the default for new workspaces) having this implemented on Windows 10 at least would help.

I know I can copy workspace properties when creating a new one, but having it as default for everything would be welcome, especially by my eyes.
Comment 3 Andrew Obuchowicz CLA 2020-10-04 01:01:13 EDT
(In reply to Marek Andreansky from comment #2)
> I know I can copy workspace properties when creating a new one, but having
> it as default for everything would be welcome, especially by my eyes.

I totally agree with you, I believe this is a Win32 SWT bug then. Unfortunately I'm not familiar with SWT on Windows, but perhaps someone else who is will chime in.
Comment 4 Lakshmi P Shanmugam CLA 2022-02-15 09:35:14 EST
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=547038#c8 for the reason it was not enabled for Windows earlier.

@Niraj, Windows & Eclipse supports native dark theme now, so can we enable this for Windows? We need to remove the OS check in ThemeEngine.java and test if it works fine.
Comment 5 Niraj Modi CLA 2022-03-10 00:33:43 EST
(In reply to Lakshmi P Shanmugam from comment #4)
> See https://bugs.eclipse.org/bugs/show_bug.cgi?id=547038#c8 for the reason
> it was not enabled for Windows earlier.
> 
> @Niraj, Windows & Eclipse supports native dark theme now, so can we enable
> this for Windows? We need to remove the OS check in ThemeEngine.java and
> test if it works fine.

Will share a gerrit shortly on this.
Comment 6 Eclipse Genie CLA 2022-03-10 00:48:35 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/191693
Comment 8 Niraj Modi CLA 2022-03-11 07:08:58 EST
(In reply to Eclipse Genie from comment #7)
> Gerrit change
> https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/191693 was merged
> to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=48420836338153cbc1ee81d150bb78ffdb496616

Resolving this bug now.
For possible improvements at Eclipse level theming raised bug 579223.
Comment 9 Joseph Benken CLA 2022-06-24 12:45:49 EDT
> Since there is no way to set up a global profile (or override the default for new workspaces) having this implemented on Windows 10 at least would help.

Does this mean it is not possible for a branding plugin to define the default theme?

I updated my branding plugin's plugin_customization.ini file, trying to set either light or classic theme but neither of these worked:
org.eclipse.e4.ui.css.swt.theme/themeId=org.eclipse.e4.ui.css.theme.e4_classic
org.eclipse.e4.ui.css.swt.theme/themeId=org.eclipse.e4.ui.css.theme.e4_default

I found I could disable themes entirely but this is not really what I want:
org.eclipse.e4.ui.workbench.renderers.swt/themeEnabled=false

So, now we have the opposite problem where dark mode (instead of light mode) can be getting forced on by default in new workspaces.  I agree the new behavior generally seems better but an Eclipse application really needs some control over what theme is used by default.  Is there a way to control this?  Do I need to put something different in my plugin_customization.ini file?  Or is there some other way or system property to disable this new force-dark-mode feature?