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

Fixes for PowerToys Awake #12215

Merged
merged 23 commits into from
Jul 13, 2021
Merged

Fixes for PowerToys Awake #12215

merged 23 commits into from
Jul 13, 2021

Conversation

dend
Copy link
Collaborator

@dend dend commented Jul 5, 2021

@dend dend marked this pull request as draft July 5, 2021 05:04
@Aaron-Junker
Copy link
Collaborator

@dend Why don't you just follow our Pull Request template? I just want to know what holds you back? Is there anything I'm overlooking here?

@dend
Copy link
Collaborator Author

dend commented Jul 6, 2021

@dend Why don't you just follow our Pull Request template? I just want to know what holds you back? Is there anything I'm overlooking here?

Nothing big @Aaron-Junker - I just wanted to use a very simplified version of it. Since I am just fixing my own tool, and y'all know who I am - thought I would just keep it brief.

@dend dend marked this pull request as ready for review July 7, 2021 00:18
@dend
Copy link
Collaborator Author

dend commented Jul 7, 2021

This should be ready for review.

Before merging: I'd love a sanity check from folks to clone this PR, build and run PowerToys, and see if Awake works on your machine. I've made a few changes that address the reported bugs, but I want to make sure that it actually works on more than my machine.

@dend
Copy link
Collaborator Author

dend commented Jul 7, 2021

Actually, after restarting PowerToys, there's no Awake icon in the system tray.
I've exited PowerToys and then started it again and there's no tray icon for Awake.

@jaimecbernardo is the module enabled in PowerToys settings? Can you check and see if the process is running in Task Manager (PowerToys.Awake.exe)?

@mykhailopylyp
Copy link
Contributor

@dend
I can also confirm that I don't have the icon in the tray.
PowerToys.Awake.exe process is running. Awake is enabled in the settings and there is an exception in event logs

Application: PowerToys.Awake.exe
CoreCLR Version: 4.700.21.21202
.NET Core Version: 3.1.15
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException: Object reference not set to an instance of an object.
   at Awake.Program.ForceExit(String message, Int32 exitCode)
   at Awake.Program.Main(String[] args)

@mykhailopylyp
Copy link
Contributor

@dend
This pr should've been divided into a few smaller ones. In this way, we can get them in faster. The rule of thumb is "one issue one pr".

@dend
Copy link
Collaborator Author

dend commented Jul 8, 2021

@mykhailopylyp - I will double-check once again to see what is going on with the icon, and where I am failing with ForceExit. Expect that change to be available today.

@dend
Copy link
Collaborator Author

dend commented Jul 9, 2021

@dend
I can also confirm that I don't have the icon in the tray.
PowerToys.Awake.exe process is running. Awake is enabled in the settings and there is an exception in event logs

Application: PowerToys.Awake.exe
CoreCLR Version: 4.700.21.21202
.NET Core Version: 3.1.15
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException: Object reference not set to an instance of an object.
   at Awake.Program.ForceExit(String message, Int32 exitCode)
   at Awake.Program.Main(String[] args)

@mykhailopylyp can you please confirm that you are using the content from this PR? ForceExit has been renamed to Exit with a bunch of changes here, so it's odd to see that in logs.

dend added 2 commits July 8, 2021 19:25
This change introduces support for:

- Proper event handling across the two apps (Awake and runner).
- Removal of unnecessary functions.
@dend dend dismissed jaimecbernardo’s stale review July 9, 2021 03:19

New changes made in code.

@mykhailopylyp
Copy link
Contributor

@mykhailopylyp can you please confirm that you are using the content from this PR? ForceExit has been renamed to Exit with a bunch of changes here, so it's odd to see that in logs.

Sorry for the confusion. This crash wasn't caused by this branch.

@dend dend requested a review from mykhailopylyp July 9, 2021 17:12
Copy link
Contributor

@mykhailopylyp mykhailopylyp left a comment

Choose a reason for hiding this comment

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

LGTM, tested, works as expected. Thank you for your contribution!

@dend
Copy link
Collaborator Author

dend commented Jul 13, 2021

Awesome - thanks for checking @mykhailopylyp 👏

@crutkas anything else we need here before we can merge?

@dend
Copy link
Collaborator Author

dend commented Jul 13, 2021

@dedavis6797 FYI - let me know if I need to make any other changes for us to merge this PR.

@mykhailopylyp
Copy link
Contributor

Let's wait for @jaimecbernardo's review as he found some issues

@jaimecbernardo
Copy link
Collaborator

I'll do a review today still. And if it's all OK, I'll merge it.

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

After keeping the computer awake temporarily, the computer can go to sleep after the time we set, but the setting never changes in the UI. The visuals show as if the mode is still "Keep awake temporarily" instead of resetting to "Off (Passive)".

This is still occurring to me. After being kept awake temporarily, the behavior returns as if it is "Off (Passive)" but the UI still shows as if the setting is to be kept awake temporarily.

@dend
Copy link
Collaborator Author

dend commented Jul 13, 2021

@jaimecbernardo this is by-design - the UI in the Settings view doesn't automatically update today. This will be an area I will look at improving in a separate release.

@dend dend dismissed jaimecbernardo’s stale review July 13, 2021 16:51

By design in the current release

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

The changes LGTM.
Great work!

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.

5 participants