Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Fix for grey background in high sierra #5

Closed
wants to merge 5 commits into from

Conversation

joevo2
Copy link

@joevo2 joevo2 commented Sep 27, 2017

Fix for #4

@joevo2 joevo2 changed the title Fix for grey background in high sierra https://github.com/vitorgalvao/fog/issues/4 Fix for grey background in high sierra Sep 27, 2017
app/main.js Outdated
@@ -70,15 +70,21 @@ app.on('ready', function() {

// Create the browser window.
mainWindow = new BrowserWindow({
backgroundColor: '#ffffff',
Copy link
Owner

Choose a reason for hiding this comment

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

According to the documentation, this is the default. Is this really needed?

And why is it here? Mind explaining the rest of the solution a bit?

Copy link
Author

Choose a reason for hiding this comment

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

I think there might be a bug with electron in high sierra as reported here electron/electron#10559 so the default colour turn grey and throw this error

Electron[10948:1810625] *** WARNING: Textured window <AtomNSWindow: 0x7ff440c1af60> is getting an implicitly transparent titlebar. This will break when linking against newer SDKs. Use NSWindow's -titlebarAppearsTransparent=YES instead.

I solve it by setting the colour to white, might not be the best solution but at least it looks better? oh wait maybe i can look into the -titlebarAppearsTransparent=YES as shown in the error.

Copy link
Owner

Choose a reason for hiding this comment

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

oh wait maybe i can look into the -titlebarAppearsTransparent=YES as shown in the error.

Please do, as the ready-to-show workaround is something I’d prefer to avoid.

Thank you for the explanation!

Copy link
Author

Choose a reason for hiding this comment

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

I think at the moment can't really be fixed? Only solution is the fallback I made? Seems to be a known issue with electron and high Sierra :( electron/electron#10521

btw there's this blue line on top, looks like a webkit highlight is that normal? tried to get rid of it but couldn't
screen shot 2017-09-29 at 10 09 28 am

Copy link
Owner

Choose a reason for hiding this comment

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

btw there's this blue line on top, looks like a webkit highlight is that normal?

It’s caused by focusing the webview, so we can use the keyboard shortcuts.

app/main.js Outdated

mainWindow.once('ready-to-show', () => {
mainWindow.show()
})
Copy link
Author

@joevo2 joevo2 Sep 29, 2017

Choose a reason for hiding this comment

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

With the solution of backgroundColor: '#ffffff' at L73 the app started with grey then turn white. So I solved it by following this tutorial by adding
show: false at mainWindow then

mainWindow.once('ready-to-show', () => {
   mainWindow.show()
 })

at L81-87

@vitorgalvao
Copy link
Owner

Thank you for the PR and the discussion.

I ended up following a slightly different route. Instead of still showing the app unloaded with a white background (not much better than having the grey background flash to white), instead don’t show the app at all until content has loaded.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants