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 white screen bug / Remove window flicker when starting hidden / Add "start automatically" setting #95

Merged
merged 3 commits into from
Jan 10, 2022

Conversation

eFail
Copy link
Contributor

@eFail eFail commented Jan 8, 2022

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.

image

- Remove window flicker when starting hidden.
- Add "start automatically" setting.
src/main.js Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
@jerrod-lankford
Copy link
Owner

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(
Copy link
Owner

@jerrod-lankford jerrod-lankford Jan 10, 2022

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?

Copy link
Contributor Author

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.

src/main.js Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
Applying node count check instead of string check

Co-authored-by: Jerrod Lankford <jllankfo@ncsu.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants