fix: save current background color if not custom #14491
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, thecustomBackgroundColor
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, butshowWindowEarly
set totrue
Follow-ups
None known
Review checklist
Reminder for reviewers