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

Do not show background tips unless focused #40

Merged
merged 3 commits into from Feb 17, 2018

Conversation

Projects
None yet
1 participant
@50Wliu
Member

50Wliu commented Feb 17, 2018

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Only show background tips when Atom is focused to preserve battery life.

In the following GIFs, the slightly highlighted line in the Task Manager represents Atom. Notice the GPU usage when Atom is and isn't focused. (Note that I decreased the display duration to 1 second for a shorter GIF)

Before After
background-tips-gpu-before background-tips-gpu-after

Alternate Designs

None.

Benefits

Uses public Atom and Electron APIs to detect when Atom isn't focused and deactivates the background tips and timers in order to save battery life. I have verified that the new listeners are disposed of correctly when the package is deactivated.

Possible Drawbacks

When Atom is still visible but not focused, no background tips will appear.

Applicable Issues

None.

50Wliu added some commits Feb 17, 2018

@50Wliu 50Wliu merged commit 5446730 into master Feb 17, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@50Wliu 50Wliu deleted the wl-battery-life branch Feb 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment