Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: save current background color if not custom #14491

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

rschnekenbu
Copy link
Contributor

What it does

This PR saves the color of the background for electron main window, even if not changed during the session. In the case for example of setting a light theme in dark mode, when the session during which the theme was saved, the customBackgroundColor was set and it is saved in the electron state. The second time, when the app is started and closed and no theme has changed, the customBackgroundColor has not been set, so its is not saved. The next time the app is started again, the white color is not restored, thus causing a dark, then white background at startup.
In conjonction with the changes to the setBackgroundColor to the main window, that should solves all issues on startup and window colors.

fix: #14428

contributed on behalf of STMicroelectronics

How to test

This can be tested on Theia Example Electron, changing its package.json not to have the splashscreen, but showWindowEarly set to true

  1. update package.json in electron example. Replace splashcreen options by "showWindowEarly" : "true"
  2. compile and run electron example
  3. change the theme to dark while in OS white theme. Restart at least twice, check at startup the windows background and try to refresh electron window (ctrl+R on linux and windows). The background color shall remain consistent.
  4. You can test also any combination of a light or dark theme on OS dark / light theme. The background shall remain consistent across several restart.
  5. You can also test a fresh start, while removing .theia folder and .config/Theia Electron Example or similar folders on windows.

Follow-ups

None known

Review checklist

Reminder for reviewers

fix: eclipse-theia#14428

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>
@rschnekenbu rschnekenbu merged commit eb9a7e4 into eclipse-theia:master Nov 26, 2024
11 checks passed
@github-actions github-actions bot added this to the 1.56.0 milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Theia not synchronize the background color of the electron window when changing the theme
2 participants