-
Notifications
You must be signed in to change notification settings - Fork 37
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 white screen bug / Remove window flicker when starting hidden / Add "start automatically" setting #95
Fix white screen bug / Remove window flicker when starting hidden / Add "start automatically" setting #95
Conversation
- Remove window flicker when starting hidden. - Add "start automatically" setting.
Two minor comments. Looks good otherwise, just need to check it on mac osx. Will do that tomorrow |
src/main.js
Outdated
// has become empty. If it has, then we automatically reload Google Voice for the | ||
// user. This seems to eliminate the problem entirely, without any adverse effects, | ||
// as once we detect an empty body, the application is already in a non-working state. | ||
win.webContents.executeJavaScript("document.getElementsByTagName('body')[0].innerText.trim()").then( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had one more thought. Instead of stringifying the contents of body every three seconds can we just check the body's child node count for length 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slick! Let me run with those changes in place today and make sure it still works. Seems like it should.
Applying node count check instead of string check Co-authored-by: Jerrod Lankford <[email protected]>
In this commit we make the following changes:
Fix "White Screen of Death"
An issue that many users experience is that after an indeterminate period of time, the main application window becomes a blank white screen. When this happens, the application stops functioning because there is no content to be checked for new notifications anymore. As far as we can tell, this is a bug in Electron, not a bug in this application or Google Voice. To work around this issue, we update our "check for new notifications" interval to be every 3 seconds instead of 1 and add an extra check to see whether the content of the window has become "blank" (the white screen of death). When we detect this state, we automatically reload Google Voice. Since the application is already broken once we detect this state, forcing a reload should have no adverse effect (data loss, for example).
Remove window flicker when starting hidden
Currently, when the "start minimized" setting is enabled, the main application window flickers on screen briefly before it gets hidden. We fix this by reversing our window creation logic. We make the window hidden initially, and then show it only if the "start minimized" setting hasn't been turned on (it's always off by default).
Add "start automatically" setting
Finally, as a companion change to the fixing of the "white screen of death" bug, we make one additional change that hopefully finalizes the user's ability to never miss a notification when using this application. In the settings dialog, we add a new "Start automatically at logon" setting.