From b788090a3aa48b8b0e2addd7095b20703717006f Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Wed, 1 Jul 2026 13:26:59 +0200 Subject: [PATCH 1/2] Keep OS high contrast colors instead of forcing the default theme When the OS runs in high contrast mode, Eclipse selects the high-contrast theme id. That theme was removed in the 2025-09 release, so the id is no longer found. Since #3854 the theme engine then forced the default (light) theme and a product/workspace default could override the high-contrast selection, which overrode the native OS high-contrast colors and left the UI unusable (mostly white). The theme engine now keeps the native OS colors instead of falling back to the default theme while the OS is in high contrast mode, and the product/workspace default no longer overrides the high-contrast theme. The fallback and default-theme behavior are unchanged outside high contrast mode. Fixes https://github.com/eclipse-platform/eclipse.platform.ui/issues/3095 --- .../eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java | 7 ++++++- .../e4/ui/internal/workbench/swt/E4Application.java | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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 42a7a0639a5..844bd280056 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 @@ -430,7 +430,12 @@ public void setTheme(String themeId, boolean restore) { return; } } - // Theme not found (e.g. it was uninstalled); fall back to default + // In OS high-contrast mode keep the native OS colors instead of forcing a theme + if (display != null && display.getHighContrast()) { + ILog.of(ThemeEngine.class) + .warn("Theme '" + themeId + "' not found; using OS high contrast colors."); //$NON-NLS-1$ //$NON-NLS-2$ + return; + } ILog.of(ThemeEngine.class) .warn("Theme '" + themeId + "' not found; falling back to default theme."); //$NON-NLS-1$ //$NON-NLS-2$ if (!E4_DEFAULT_THEME_ID.equals(themeId)) { diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java index e544e7744b9..fe21a544490 100644 --- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java +++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java @@ -324,8 +324,8 @@ private void setCSSContextVariables(IApplicationContext applicationContext, IEcl context.set(E4Application.THEME_ID, DEFAULT_THEME_ID); } } else { - // Check if user has overridden the branding/command-line theme - String userThemeId = getProductScopedThemeId(); + // Do not let a product/workspace default override the OS high-contrast theme + String userThemeId = highContrastMode ? null : getProductScopedThemeId(); if (userThemeId != null) { context.set(E4Application.THEME_ID, userThemeId); } else { From c1f6534258c82f00c579140e68af393d4eb113e8 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Wed, 1 Jul 2026 17:53:12 +0200 Subject: [PATCH 2/2] Increase version of org.eclipse.e4.ui.workbench.swt The high-contrast fix changes E4Application in org.eclipse.e4.ui.workbench.swt, whose version was not yet increased in this development stream, so bump its service segment to satisfy the version baseline check. --- bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF index 37a7e9d1ea0..75d82205e69 100644 --- a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.ui.workbench.swt;singleton:=true -Bundle-Version: 0.18.100.qualifier +Bundle-Version: 0.18.200.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin