Bug 567563 - [Win32] Eclipse could set dark mode based on os settings. - Removed the OS check for MAC and GTK platforms. - Fixed bundle version in project: org.eclipse.e4.ui.workbench.renderers.swt Change-Id: I4632f1279b830d71bbb4d153d7f129238652a5b2 Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/191693 Tested-by: Platform Bot <platform-bot@eclipse.org>
diff --git a/bundles/org.eclipse.e4.ui.css.swt.theme/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.css.swt.theme/META-INF/MANIFEST.MF index 32d93a3..346420b 100644 --- a/bundles/org.eclipse.e4.ui.css.swt.theme/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.e4.ui.css.swt.theme/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.ui.css.swt.theme;singleton:=true -Bundle-Version: 0.13.0.qualifier +Bundle-Version: 0.13.100.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java b/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java index 5de36ab..5019d7b 100644 --- a/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java +++ b/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2018 Tom Schindl and others. + * Copyright (c) 2010, 2022 Tom Schindl and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -609,15 +609,13 @@ } } - // For Mac & GTK, if the system has Dark appearance set and Eclipse is using the - // default settings, then start Eclipse in Dark theme. - - // Check that there is a dark theme present + /* + * Any Platform: if the system has Dark appearance set and Eclipse is using the + * default settings, then start Eclipse in Dark theme. Check that there is a + * dark theme present. + */ boolean hasDarkTheme = getThemes().stream().anyMatch(t -> t.getId().startsWith(E4_DARK_THEME_ID)); - - String os = Platform.getOS(); - String themeToRestore = (Platform.OS_LINUX.equals(os) || Platform.OS_MACOSX.equals(os)) - && Display.isSystemDarkTheme() && hasDarkTheme ? E4_DARK_THEME_ID : alternateTheme; + String themeToRestore = Display.isSystemDarkTheme() && hasDarkTheme ? E4_DARK_THEME_ID : alternateTheme; if (themeToRestore != null && flag) { setTheme(themeToRestore, false); }