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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- ## 1.56.0 - not yet released -->
<a name="breaking_changes_1.56.0">[Breaking Changes:](#breaking_changes_1.56.0)</a>
- [core] Do not dispose dialogs on close - [#14456](https://github.com/eclipse-theia/theia/pull/14456) - Contributed on behalf of STMicroelectronics

- [core] fixed electron win background color [#14491](https://github.com/eclipse-theia/theia/pull/14491) - Contributed on behalf of STMicroelectronics
- [plugin] added stubs for the additional LanguageModel APIs [#14446](https://github.com/eclipse-theia/theia/pull/14446) - Contributed on behalf of STMicroelectronics
- [plugin] added support for ThemeColor property id [#14437](https://github.com/eclipse-theia/theia/pull/14437) - Contributed on behalf of STMicroelectronics
- [plugin] supported MappedEditProviders proposed API evolution [#14453](https://github.com/eclipse-theia/theia/pull/14453) - Contributed on behalf of STMicroelectronics
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/electron-main/electron-main-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export class ElectronMainApplication {
}

setBackgroundColor(webContents: WebContents, backgroundColor: string): void {
BrowserWindow.fromWebContents(webContents)?.setBackgroundColor(backgroundColor);
this.customBackgroundColor = backgroundColor;
this.saveState(webContents);
}
Expand Down Expand Up @@ -628,7 +629,7 @@ export class ElectronMainApplication {
y: bounds.y,
frame: this.useNativeWindowFrame,
screenLayout: this.getCurrentScreenLayout(),
backgroundColor: this.customBackgroundColor
backgroundColor: this.customBackgroundColor ?? electronWindow.getBackgroundColor()
};
this.electronStore.set('windowstate', options);
} catch (e) {
Expand Down
Loading