Closed ghentschke closed 8 months ago
I am not sure if this should be fixed here or in the caller in LSP4E. Should the user be aware, that this method should be called from within a UI thread only?
That is nowhere specified. Most of the code in the tm4e.ui package expects to be running on the UI thread. Anyways, I added a workaround for this case. Can you please give the latest snapshot build a shot? https://download.eclipse.org/tm4e/snapshots/
A first check seems very promising. @sebthom Thank you for the fast fix!
Has the default theme changed as well? TMUIPlugin.getThemeManager().getDefaultTheme()
returns now the dark theme.
The default theme depends on the Eclipse UI theme and should only return the dark theme if Eclipse itself is dark.
This is the integration test: https://github.com/eclipse/tm4e/blob/33dbe0128a1f061b422cc49ca61a5f1f94e4cf8e/org.eclipse.tm4e.ui.tests/src/main/java/org/eclipse/tm4e/ui/tests/themes/ThemeManagerTest.java#L33-L34
What has changed is, that we now don't try to guess the Eclipse theme based on theme names but by measuring brightness of the active shell's background color.
Maybe this does not work in some scenarios. It is working fine for me on Windows 10.
I released TM4E 0.10.3 which contains the fix. Thanks for reporting the issue!
Due to a failed unit test in LSP4E it turns out that since this TM4E commit a
IllegalStateException
will be thrown byAbstractThemeManager.getDefaultTheme()
, when this method gets called from within a non UI thread:https://github.com/eclipse/tm4e/blob/039aed1cef856bdfd714cbc56606d33da43a6704/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/AbstractThemeManager.java#L57
I am not sure if this should be fixed here or in the caller in LSP4E. Should the user be aware, that this method should be called from within a UI thread only?: