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

Add background color to mainWindow to prevent white flashes while launching #274

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions src/electron-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ app.on('ready', async () => {
const preloadScript = path.normalize(`${__dirname}/preload.js`);
mainWindow = global.mainWindow = new BrowserWindow({
// https://www.electronjs.org/docs/faq#the-font-looks-blurry-what-is-this-and-what-can-i-do
backgroundColor: '#fff',
backgroundColor: '#16191e',
pedr0luiz marked this conversation as resolved.
Show resolved Hide resolved

icon: iconPath,
show: false,
Expand Down Expand Up @@ -1015,7 +1015,9 @@ app.on('window-all-closed', () => {
});

app.on('activate', () => {
mainWindow.show();
mainWindow.once('ready-to-show', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, the background color might also be a moot point if you’re using the ready-to-show event…

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, but this line seems to do nothing.

mainWindow.show();
});
});

function beforeQuit() {
Expand Down