Skip to content

Conversation

@fedejeanne
Copy link
Member

@fedejeanne fedejeanne commented Jul 30, 2025

Fixes #3095

How to test

  • Before checking out this PR, start the Runtime Application and set the theme to High Contrast
  • Checkout this PR
  • Start the Runtime Application

Expected outcome

  • The application should switch automatically to the default theme: Light.
  • There should be no High Contrast theme available in the preferences anymore

@fedejeanne
Copy link
Member Author

cc @vogella

@eclipse-platform-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 5ac699ba87b21cfc331e25dfcb55bc504e67003f Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <[email protected]>
Date: Wed, 30 Jul 2025 18:48:19 +0000
Subject: [PATCH] Version bump(s) for 4.37 stream


diff --git a/bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF
index 11d118fd4c..a1a0eafd86 100644
--- a/bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.ui.themes;singleton:=true
-Bundle-Version: 1.2.2800.qualifier
+Bundle-Version: 1.2.2900.qualifier
 Bundle-Vendor: %Plugin.providerName
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.e4.ui.css.swt.theme
-- 
2.50.1

Further information are available in Common Build Issues - Missing version increments.

@iloveeclipse
Copy link
Member

Wasn't there some user asking to keep it? I can't find the comment on original issue, but I believe there was one.
Could you ask on mailing lists before removing it?

@github-actions
Copy link
Contributor

github-actions bot commented Jul 30, 2025

Test Results

 2 778 files  ±0   2 778 suites  ±0   1h 38m 46s ⏱️ + 4m 12s
 7 932 tests ±0   7 704 ✅ ±0  228 💤 ±0  0 ❌ ±0 
23 351 runs  ±0  22 605 ✅ ±0  746 💤 ±0  0 ❌ ±0 

Results for commit e3f02aa. ± Comparison against base commit 8642aa5.

♻️ This comment has been updated with latest results.

@fedejeanne
Copy link
Member Author

I'll draft it until we decide how to proceed.

Open questions: do we disable theming when to OS is set to use High Contrast? ATM only Windows was capable of reporting if High Contrast was enabled, but I know for a fact that Ubuntu has a High Contrast option too and maybe even Mac does? If that is correct then we need to adapt the implementations of Display::getHighContrast() for Linux and Mac and decide what to do when it's activated.

@fedejeanne fedejeanne marked this pull request as draft August 1, 2025 09:23
@vogella
Copy link
Contributor

vogella commented Aug 1, 2025

+1 for disabling theming if high contrast is enabled. This looks the best



Currently only working for Windows since Linux and Mac do not report
about high contrast mode being enabled/disabled.

Contributes to
eclipse-platform#3095
@fedejeanne
Copy link
Member Author

Commit e3f02aa is an attempt to update the preferences dialog accordingly (disabling theming) when high contrast is activated.

Considerations:

  • Only works on Windows (since Linux and Mac do not report the high contrast ATM)
  • The UX is not ideal but IMO is pretty good considering that disabling theming is (even on master) a bit "buggy". If you for example enable/disable theming, apply and close but without restarting then the next time you open the Appearance preference, the UI does not reflect the current status but the last saved status.

Feedback is welcome (the PR remains drafted though).

@laeubi
Copy link
Contributor

laeubi commented Aug 4, 2025

Commit e3f02aa is an attempt to update the preferences dialog accordingly (disabling theming) when high contrast is activated.

You might want to share a screenshot here to get more feedback.

@akurtakov
Copy link
Member

Adding some support for Linux based on (oversimplified) themeName.contains("HighContrast") should be fairly trivial and I can do it needed.

@fedejeanne
Copy link
Member Author

Here's a screenshot of the preferences when High contrast is enabled (Windows)

High Contrast enabled (Windows)

image

The checkbox Enable Theming is disabled (in color green) and unchecked.

@fedejeanne
Copy link
Member Author

Adding some support for Linux based on (oversimplified) themeName.contains("HighContrast") should be fairly trivial and I can do it needed.

... but we want to remove the high contrast theme. How would themeName.contains("HighContrast") ever yield true, @akurtakov ?

@akurtakov
Copy link
Member

Adding some support for Linux based on (oversimplified) themeName.contains("HighContrast") should be fairly trivial and I can do it needed.

... but we want to remove the high contrast theme. How would themeName.contains("HighContrast") ever yield true, @akurtakov ?

It will check Gtk theme name(https://wiki.archlinux.org/title/GTK) not Eclipse theme name. If the Gtk theme name contains HighContrast SWT Display.isHighContrast will return true, otherwise it will return false.

@fedejeanne
Copy link
Member Author

It will check Gtk theme name(https://wiki.archlinux.org/title/GTK) not Eclipse theme name.

🤯

In that case, you could also check for "ContrastHigh" since there is one for Mate that's called "ContrastHighInverse" (and there might be more like that?)

@akurtakov
Copy link
Member

eclipse-platform/eclipse.platform.swt#2372 - Gtk implementation

@fedejeanne
Copy link
Member Author

eclipse-platform/eclipse.platform.swt#2372 - Gtk implementation

Thank you! One thing that just occurred to me is: does the mechanism to notify the user about a change in the "High Contrast" also work on Linux? On Windows, when I activate the High Contrast setting (at OS level) I get this dialog asking me to restart:

image

Which comes from here:

@Override
public void handleEvent(org.eclipse.swt.widgets.Event event) {
if (Display.getCurrent().getHighContrast() == currentHighContrast)
return;
currentHighContrast = !currentHighContrast;
// make sure they really want to do this
if (new MessageDialog(null, IDEWorkbenchMessages.SystemSettingsChange_title, null,
IDEWorkbenchMessages.SystemSettingsChange_message, MessageDialog.NONE, 1,
IDEWorkbenchMessages.SystemSettingsChange_yes, IDEWorkbenchMessages.SystemSettingsChange_no)
.open() == Window.OK) {
PlatformUI.getWorkbench().restart();
}
}
};

Does this also currently work on Linux, @akurtakov ? If not, it might be worth considering adding (in another PR).

@akurtakov
Copy link
Member

Detection of "high contrast" theme on startup works just fine on Linux. Runtime theme change doesn't seem to "fire" settings event on Gtk. That would have to be fixed on SWT side but it is not a blocker for this PR.

@akurtakov
Copy link
Member

eclipse-platform/eclipse.platform.swt#2372 - Gtk implementation

Thank you! One thing that just occurred to me is: does the mechanism to notify the user about a change in the "High Contrast" also work on Linux? On Windows, when I activate the High Contrast setting (at OS level) I get this dialog asking me to restart:
image

Does this also currently work on Linux, @akurtakov ? If not, it might be worth considering adding (in another PR).

It works on Linux now with Latest I-build. IMO the PR is good to be merged.

@fedejeanne
Copy link
Member Author

It works on Linux now with Latest I-build. IMO the PR is good to be merged.

I didn't have time to look into Mac yet and I got no answer from other Mac users. Maybe we could wait until M1?

@akurtakov
Copy link
Member

@Phillipus maybe you can provide some Mac feedback here?

@Phillipus
Copy link
Contributor

@Phillipus maybe you can provide some Mac feedback here?

Isn't High Contrast a Windows only theme? I don't see it on Mac or Linux.

@akurtakov
Copy link
Member

image I have it on Linux.

@Phillipus
Copy link
Contributor

OK, it's not on Mac.

@vogella
Copy link
Contributor

vogella commented Aug 6, 2025

Let's merge in this case

@fedejeanne fedejeanne marked this pull request as ready for review August 6, 2025 18:47
@fedejeanne
Copy link
Member Author

Let's merge in this case

Ok.

FTR the check failure seems unrelated:

19:01:34.743 [ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:5.0.0-SNAPSHOT:compare-version-with-baselines (compare-attached-artifacts-with-release) on project org.eclipse.text: Baseline and reactor have the same fully qualified version, but different content
19:01:34.743 [ERROR] different
19:01:34.743 [ERROR]    META-INF/ECLIPSE_.RSA: present in baseline only
19:01:34.743 [ERROR]    META-INF/ECLIPSE_.SF: present in baseline only
19:01:34.743 [ERROR] -> [Help 1]
...

... but I see that the Code Analysis check started running again. I'll wait.

@fedejeanne
Copy link
Member Author

Same as before, the check failure is unrelated.

Merging.

@fedejeanne fedejeanne merged commit a7d2795 into eclipse-platform:master Aug 6, 2025
16 of 18 checks passed
@fedejeanne fedejeanne deleted the remove_high_contrast_theme branch August 6, 2025 19:40
@fedejeanne
Copy link
Member Author

The nightly tests look good so I think it's safe to say: Adiós, high contrast theme. One less outdated feature to maintain 👏 .

Thank you all for your contribution!

IMO this is worthy of an N&N entry. Does anyone want to do the honors? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retire High Contrast Theme

7 participants