-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Awake and DevEx improvements #44795
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
base: main
Are you sure you want to change the base?
Awake and DevEx improvements #44795
Conversation
Added documentation for issue microsoft#44134 explaining that enabling 'Keep display on' uses ES_DISPLAY_REQUIRED, which blocks Windows Task Scheduler from detecting idle state and prevents scheduled maintenance tasks. Provided workarounds and referenced relevant Microsoft documentation.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Resolved tray icon not appearing after Windows updates by increasing retry attempts and delays for Add operations. Fixed tray icon not disappearing when Awake is disabled by allowing Delete operations without an icon. Addressed potential stack overflow in EXPIRABLE mode by adding an early return after correcting expiration times.
| - [#41674](https://github.com/microsoft/PowerToys/issues/41674) Fixed silent failure when `SetThreadExecutionState` fails. The monitor thread now handles the return value, logs an error, and reverts to passive mode with updated tray icon. | ||
| - [#38770](https://github.com/microsoft/PowerToys/issues/38770) Fixed tray icon failing to appear after Windows updates. Increased retry attempts and delays for icon Add operations (10 attempts, up to ~15.5 seconds total) while keeping existing fast retry behavior for Update/Delete operations. | ||
| - [#40501](https://github.com/microsoft/PowerToys/issues/40501) Fixed tray icon not disappearing when Awake is disabled. The `SetShellIcon` function was incorrectly requiring an icon for Delete operations, causing the `NIM_DELETE` message to never be sent. | ||
| - [#40659](https://github.com/microsoft/PowerToys/issues/40659) Fixed potential stack overflow crash in EXPIRABLE mode. Added early return after SaveSettings when correcting past expiration times, matching the pattern used by other mode handlers to prevent re-entrant execution. |
Check failure
Code scanning / check-spelling
Forbidden Pattern Error documentation
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. These words are not needed and should be removedATX cppcoreguidelinesSome files were automatically ignored 🙈These sample patterns would exclude them: You should consider adding them to: File matching is via Perl regular expressions. To check these files, more of their words need to be in the dictionary than not. You can use To update file exclusions and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the [email protected]:dend/PowerToys.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/c635c2f3f714eec2fcf27b643a1919b9a811ef2e/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/21128469821/attempts/1' &&
git commit -m 'Update check-spelling metadata'Forbidden patterns 🙅 (1)In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves. These forbidden patterns matched content: Should be
|
This PR contains a set of bug fixes and general improvements to Awake and developer experience tooling for building the module.
Awake Fixes
Awake settings are ignored when PC is woken from sleep #32544 - Fixed an issue where Awake settings became non-functional after the PC wakes from sleep. Added
WM_POWERBROADCASThandling to detect system resume events (PBT_APMRESUMEAUTOMATIC,PBT_APMRESUMESUSPEND) and re-applySetThreadExecutionStateto restore the awake state.Awake does not work if DC power is connected #36150 - Fixed an issue where Awake would not prevent sleep when AC power is connected. Added
PBT_APMPOWERSTATUSCHANGEhandling to re-applySetThreadExecutionStatewhen the power source changes (AC/battery transitions).[Awake] SetThreadExecutionState failure not handled - silent failure bug when changing state #41674 - Fixed silent failure when
SetThreadExecutionStatefails. The monitor thread now handles the return value, logs an error, and reverts to passive mode with updated tray icon.[Awake] Inconsistency in --display-on default behaviour and documentation #41738 - Fixed
--display-onCLI flag default fromtruetofalseto align with documentation and PowerToys settings behavior. This is a breaking change for scripts relying on the undocumented default.[Awake] WM_COMMAND message processing flaw #41918 - Fixed
WM_COMMANDmessage processing flaw inTrayHelper.WndProcthat incorrectly compared enum values against enum count. Added proper bounds checking for custom tray time entries.Scheduled TRIM doesn't happen with Awake enabled. #44134 - Documented that
ES_DISPLAY_REQUIRED(used when "Keep display on" is enabled) blocks Task Scheduler idle detection, preventing scheduled maintenance tasks like SSD TRIM. Workaround: disable "Keep display on" or manually runOptimize-Volume -DriveLetter C -ReTrim.Awake Icon in tray is missing after windows update #38770 - Fixed tray icon failing to appear after Windows updates. Increased retry attempts and delays for icon Add operations (10 attempts, up to ~15.5 seconds total) while keeping existing fast retry behavior for Update/Delete operations.
The Awake tray icon does not disappear #40501 - Fixed tray icon not disappearing when Awake is disabled. The
SetShellIconfunction was incorrectly requiring an icon for Delete operations, causing theNIM_DELETEmessage to never be sent.Fixed an issue where toggling "Keep screen on" during an active timed session would disrupt the countdown timer. The display setting now updates directly without restarting the timer, preserving the exact remaining time.
Developer Experience
setup-dev-environment.ps1script to automate development environment setup.