feat(dsc): add ZoomIt settings function data #50551

Open
Gijsreyn opened 5:08am on September 13, 2026 wants to merge 302 Ξ” into microsoft/powertoys main from
gh-50550/main/fix-zoomit-settings-read
Gijsreyn authored
of work during September 13
Diff Delta:
302
About 92 Diff Delta/hour
Classified as:  Bug Fix, Feature Add

Gijsreyn's Description of Work

Summary of the Pull Request

This PR fixes the ZoomIt module of the Microsoft DSC settings resource (Microsoft.PowerToys/ZoomItSettings). ZoomIt stores its settings in the registry (HKCU\Software\Sysinternals\ZoomIt), but the resource mapped ZoomIt to the generic file-based path and read and wrote %LOCALAPPDATA%\Microsoft\PowerToys\ZoomIt\settings.json, a file ZoomIt never reads. As a result get/export returned empty defaults, set reported success without changing anything, and test never detected drift.

The module now reads and writes the settings through PowerToys.ZoomItSettingsInterop (ZoomItSettings.LoadSettingsJson/SaveSettingsJson), the same component the PowerToys Settings app uses, and signals the ZOOMIT_REFRESH_SETTINGS_EVENT so a running ZoomIt instance reloads immediately.

resources:

- name: Configure ZoomIt
type: Microsoft.PowerToys/ZoomItSettings
properties:
settings:
properties:
ToggleKey:
value: { win: false, ctrl: true, alt: false, shift: true, code: 90, key: Z }
BreakTimeout: { value: 15 }
name: ZoomIt
version: 1.0

PR Checklist


  • [x] Closes: #50550
    <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) -->

  • [ ] Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected

  • [x] Tests: Added/updated and all pass (SettingsResourceZoomItModuleTest in PowerToys.DSC.UnitTests: get/export/set/test through an in-memory stand-in for the interop so the tests never touch the registry, the refresh event signal, and a read-only round trip through the real interop)

  • [x] Localization: All end-user-facing strings can be localized (no new strings)

  • [x] Dev docs: Added/updated (doc/dsc/modules/ZoomIt.md)

  • [ ] New binaries: Added on the required places β€” n/a: no new binaries. PowerToys.DSC.csproj gains a project reference to ZoomItSettingsInterop.vcxproj and generates its C# projection (CsWinRTIncludes), as PowerToys.Settings.csproj does; PowerToys.ZoomItSettingsInterop.dll already ships next to PowerToys.DSC.exe in the installation root



  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx
    ## Validation Steps Performed

Built PowerToys.DSC and PowerToys.DSC.UnitTests and ran the full DSC unit-test suite.

Building updated commit group diff...
4 total changed files
(1 file ignored)
Loading changes...
Loading changes...
Loading changes...