Skip to content

[PD] Re-enable PowerDisplay #46489

Merged
moooyo merged 26 commits intomainfrom
yuleng/pd/1
Apr 10, 2026
Merged

[PD] Re-enable PowerDisplay #46489
moooyo merged 26 commits intomainfrom
yuleng/pd/1

Conversation

@moooyo
Copy link
Copy Markdown
Contributor

@moooyo moooyo commented Mar 25, 2026

Summary of the Pull Request

  1. Re-enable PowerDisplay for PowerToys.
  2. Add PowerDisplay back into installer.
  3. Use new PowerDisplay icon and logo.
  4. Fix some DPI related issue.
  5. UI/UX improvement.

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Pull new code from this branch. Set up PowerDisplay.UI as startup project. Click run in VS.

Or, build whole solution, set up runner as startup project. Click run to test full experience.

….Lib

- Create PowerDisplay.Models project with shared model types (ColorPresetItem,
  CustomVcpValueMapping, PowerDisplayProfile, PowerDisplayProfiles,
  ProfileMonitorSetting) and ProfileHelper/ProfileSerializationContext
- Remove Settings.UI and Settings.UI.Library dependency on PowerDisplay.Lib
- Clean up VcpNames: remove LocalizedCodeNameProvider, GetValueMappings,
  GetFormattedValueName with custom mapping overload (keep 4 methods)
- Refactor ProfileService: delegate Load/Save to ProfileHelper, remove
  unused methods (ProfilesFileExists, GetProfilesFilePath), simplify
  IProfileService interface
- Remove legacy CustomProfileName constant and cleanup code
- Add CustomVcpValueMappingExtensions in Lib for rich display properties
- Create MonitorStateSerializationContext for Lib-local state types

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@moooyo moooyo self-assigned this Mar 25, 2026
Restores PowerDisplay across the PowerToys solution, including build, packaging, signing, and UI integration in Settings, OOBE, and Dashboard. Refactors PowerDisplay app to use CommunityToolkit.Mvvm for ViewModels, moves control logic from code-behind to ViewModels, and modernizes XAML for improved accessibility and theming. Updates group policy support, resource strings, and installer logic. Removes obsolete code and improves maintainability and user experience.
@github-actions

This comment has been minimized.

Changed icon column widths in control grids to fixed 20px for consistent spacing. Disabled text scaling for monitor numbers to ensure uniform appearance regardless of system text size settings.
@github-actions

This comment has been minimized.

Yu Leng (from Dev Box) and others added 2 commits March 31, 2026 12:21
Added "NOTOPMOST" after "nosize-notopmost" in expect.txt to update the list of recognized terms. No other modifications were made.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread src/modules/powerdisplay/PowerDisplay/Helpers/WindowHelper.cs Fixed
Comment thread src/modules/powerdisplay/PowerDisplay/Helpers/WindowHelper.cs Fixed
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Yu Leng (from Dev Box) and others added 3 commits March 31, 2026 16:57
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move load→modify→save sequences into ProfileHelper so both
Settings.UI and PowerDisplay.exe share a single lock-protected
path. Add AddOrUpdateProfile, RenameAndUpdateProfile, RemoveProfile,
and GetProfile as atomic helpers; split public methods into lock-free
*Core variants called under _lock. ProfileService becomes a thin
one-liner façade with no private state. PowerDisplayViewModel now
calls single-method helpers instead of open-coding three-step ops.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All other entries in generateAllFileComponents.ps1 end the -depsPath
argument with a backslash for consistency; the PowerDisplay entry
was missing it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread src/modules/powerdisplay/PowerDisplay.Models/ProfileHelper.cs Fixed
@github-actions

This comment has been minimized.

Remove blank line after single-line comment in ProfileHelper.cs
(SA1512). Add using alias in ProfileService.cs to disambiguate
ProfileHelper from PowerDisplay.Models vs the same-named class in
PowerDisplay.Common.Utils (CS0117).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

- Check GPO disabled state early in Program.cs before instance registration
- Gate all activation paths (toggle event, launch action, send_message) on
  IsActivationAllowed (GPO + module enabled)
- Move StartToggleEventListener to enable() / StopToggleEventListener to
  disable() so the listener only runs while the module is active
- Fix send_message bug that unconditionally set m_enabled = true when the
  process was not running

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

Yu Leng (from Dev Box) and others added 3 commits April 1, 2026 11:16
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
niels9001 and others added 6 commits April 3, 2026 11:01
… disable, AOT partial props

- Wire rotation ComboBox: bind SelectedIndex TwoWay to SelectedRotationIndex,
  add IsEnabled binding and localized x:Uid strings for ComboBoxItem
- Change tray icon trigger from WM_LBUTTONDBLCLK to WM_LBUTTONUP (single click)
- Disable profile editor SettingsCards when monitor ToggleSwitch is off
- Migrate [ObservableProperty] fields to partial property syntax (MVVMTK0045)
- Add LangVersion=preview to PowerDisplay.csproj for MVVM Toolkit partial support

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts:
#	src/modules/powerdisplay/PowerDisplay.Lib/Utils/VcpNames.cs
Improve window placement logic to use coordinates relative to display area bounds, fixing issues with centering and bottom-right positioning on multi-monitor and high-DPI setups. Add _isShowingWindow flag to prevent unwanted auto-hide during activation. Remove redundant visibility checks. Adjust IdentifyWindow activation order for correct placement. Add clarifying comments and clean up helper methods.
Introduce DpiSuppressor to subclass WndProc and suppress WM_DPICHANGED during MoveAndResize, preventing double-scaling when moving windows across monitors with different DPI. Refactor HotkeyService to use a message handler instead of its own WndProc subclass, allowing both hotkey and DPI suppression logic to coexist. Update window positioning logic for accuracy, implement IDisposable for IdentifyWindow, and ensure proper disposal of resources. Improves multi-monitor DPI reliability and centralizes WndProc handling.
Comment thread src/modules/powerdisplay/PowerDisplay/Helpers/DpiSuppressor.cs Fixed
@github-actions

This comment has been minimized.

Removed enforcement of WindowMinHeightDip in window sizing logic. The window's height now adapts solely to content and available space, allowing it to shrink below the previous minimum. Adaptive max height calculation is also simplified to use only the work area ratio, improving responsiveness to screen size.
@github-actions

This comment has been minimized.

@moooyo
Copy link
Copy Markdown
Contributor Author

moooyo commented Apr 9, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@moooyo moooyo changed the title Extract PowerDisplay.Models to decouple Settings.UI from PowerDisplay… [PD] Re-enable PowerDisplay Apr 9, 2026
@moooyo moooyo marked this pull request as ready for review April 9, 2026 17:21
@moooyo moooyo requested a review from a team as a code owner April 9, 2026 17:21
@moooyo moooyo merged commit 0089de3 into main Apr 10, 2026
22 checks passed
@moooyo moooyo deleted the yuleng/pd/1 branch April 10, 2026 17:08
@LegendaryBlair LegendaryBlair added this to the PowerToys 0.99 milestone Apr 15, 2026
@LegendaryBlair LegendaryBlair added the Product-Display management Refers to the idea of a display management utility power toy label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Display management Refers to the idea of a display management utility power toy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quick Display adjustment PowerToy

5 participants