-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[General] Handle Windows session end in native module processes #49539
Copy link
Copy link
Open
Labels
Issue-BugSomething isn't workingSomething isn't workingNeeds-TriageFor issues raised to be triaged and prioritized by internal Microsoft teamsFor issues raised to be triaged and prioritized by internal Microsoft teamsProduct-Always On TopRefers to the idea of a Always on Top PowertoyRefers to the idea of a Always on Top PowertoyProduct-CropAndLockRefers to the Crop and Lock PowerToysRefers to the Crop and Lock PowerToysProduct-FancyZonesRefers to the FancyZones PowerToyRefers to the FancyZones PowerToyProduct-GeneralRefers to general PowerToys functionalityRefers to general PowerToys functionalityProduct-Grab And MoveProduct-Keyboard ManagerProduct-Shortcut GuideRefers to the Shortcut Guide PowerToyRefers to the Shortcut Guide PowerToyProduct-WorkspacesRefers to the Workspaces utilityRefers to the Workspaces utilityProduct-ZoomItRefers to the ZoomIt toolRefers to the ZoomIt tool
Description
Metadata
Metadata
Assignees
Labels
Issue-BugSomething isn't workingSomething isn't workingNeeds-TriageFor issues raised to be triaged and prioritized by internal Microsoft teamsFor issues raised to be triaged and prioritized by internal Microsoft teamsProduct-Always On TopRefers to the idea of a Always on Top PowertoyRefers to the idea of a Always on Top PowertoyProduct-CropAndLockRefers to the Crop and Lock PowerToysRefers to the Crop and Lock PowerToysProduct-FancyZonesRefers to the FancyZones PowerToyRefers to the FancyZones PowerToyProduct-GeneralRefers to general PowerToys functionalityRefers to general PowerToys functionalityProduct-Grab And MoveProduct-Keyboard ManagerProduct-Shortcut GuideRefers to the Shortcut Guide PowerToyRefers to the Shortcut Guide PowerToyProduct-WorkspacesRefers to the Workspaces utilityRefers to the Workspaces utilityProduct-ZoomItRefers to the ZoomIt toolRefers to the ZoomIt tool
Microsoft PowerToys version
Main after PR #48363
Installation method
Dev build in Visual Studio
Area(s) with issue?
General
Steps to reproduce
PR #48363 fixes
APPLICATION_HANG_QUIESCEfor the always-on PowerToys runner and addshandle_stateless_session_end_messagefor processes that have no unsaved user state.Several native module processes also own top-level or message-only windows and run independent message loops without handling
WM_QUERYENDSESSION/WM_ENDSESSION. During shutdown, sign-out, or restart, those processes can remain blocked inGetMessageuntil Windows' quiesce timeout force-terminates them.Track an inventory and per-module rollout here. Known candidates include FancyZones, Always On Top, Keyboard Manager Engine, Workspaces Window Arranger, Measure Tool, Crop And Lock, Grab And Move, ZoomIt SelectRectangle, Shortcut Guide, and the notifications COM activator. Each module must review its teardown behavior independently. The shared helper is only appropriate when the process has no unsaved state; stateful modules need their own save/permission behavior.
✔️ Expected Behavior
Affected modules respond immediately to
WM_QUERYENDSESSION, unwind promptly onWM_ENDSESSION(TRUE), and preserve any required user state or child-process cleanup. Shutdown, sign-out, and restart should not produceAPPLICATION_HANG_QUIESCEreports for these module processes.❌ Actual Behavior
The runner is addressed by PR #48363, but module-owned windows are not yet migrated and may still time out during the Windows session-end handshake.
Additional Information
This is intentionally separate from PR #48363 so module-specific state and teardown semantics can be reviewed in focused changes. Related issue #41260 tracks the same failure class for Command Palette extensions.
Other Software
N/A