Repository navigation
Add Display Profiles for saved monitor topologies - #51103
Draft
Francesco Vecchio (Rhaegal222) wants to merge 30 commits into
Draft
Francesco Vecchio (Rhaegal222) wants to merge 30 commits into
Francesco Vecchio (Rhaegal222) wants to merge 30 commits into
Conversation
- Implemented KeyboardHook class to handle keyboard events for Escape and Xbox buttons. - Created MonitorPowerCommandsProvider to manage command items for the Monitor Power extension. - Added CreateProfilePage and MonitorPowerListPage for user interaction with display profiles. - Introduced resource files for localization and UI text management. - Established project structure and dependencies in the MonitorPowerExtension.csproj file.
…ndency - Replace keyboard hook with XInput polling (Guide button generates no WM_KEYDOWN) - Guide+View combo fires CycleSavedProfiles() instead of old CycleTopology - Use ApplySavedProfileReference → ActivateDisplays → CDSE fallback (SetDisplayConfig returns error 87 on this build) - Remove XboxTripleTapped stub (MissingMethodException on old binary) - Remove Microsoft.Terminal.UI C++ dependency from CmdPal.UI.csproj - C# reimplementations: IconPathConverter.IconSourceMUX() in IconPathConverter.cs - C# reimplementation: RunHistory.CreateRunHistory() inlined in RunHistoryService.cs - Fix StyleCop SA1512/SA1025 and CA2101 warnings - Add unit tests for display profile helpers and CDSE activation
…Converter/RunHistory C# ports, XboxTripleTapped removed
- Introduced the Monitor Power Extension project with support for managing monitor profiles. - Added new error message resource for no active monitors remaining. - Created a PowerShell script to extend all monitors using DisplaySwitch.exe and SetDisplayConfig. - Updated App.xaml.cs to include MonitorPowerCommandsProvider in the service configuration. - Added README.md to document profile storage locations and usage instructions.
…or display profiles
- Introduced Create-Profiles2.ps1 for generating monitor profiles based on target IDs and layout configurations from display-layout.json. - Implemented MonitorPower-Tool.ps1 for unified monitor management, including commands to extend displays, save and restore layouts, and test display configurations. - Added display-layout.json as a reference layout for monitor configurations, detailing properties such as resolution, frequency, and orientation for multiple displays.
…r-command-palette
…iguration querying
…ling - Enhanced DisplayProfilesPage.xaml.cs to support capturing keyboard shortcuts and improved error handling during initialization. - Added functionality for managing display profiles, including saving, overwriting, renaming, and duplicating profiles with user confirmation dialogs. - Introduced new ViewModel properties to track loading states and diagnostics. - Created ControllerChord and KeyboardActivationShortcut classes for better handling of controller inputs and keyboard shortcuts. - Implemented MonitorPowerProfile and persistence logic for saving and loading profiles in JSON format. - Added unit tests for profile persistence, topology mapping, controller chord parsing, and keyboard shortcut validation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nality - Removed unused PreviewKeyDown event handler and related logic for capturing activation shortcuts. - Enhanced the DisplayProfilesPage.xaml layout by adding a built-in badge for profiles and adjusting button visibility based on profile type. - Updated the controller shortcut functionality to capture and display the correct chord for Xbox controllers, changing the default from "Guide + View" to "View + A". - Simplified the diagnostics log opening process and removed unnecessary diagnostics refresh logic. - Introduced built-in profile handling to prevent overwriting reserved names and improved user feedback for profile actions. - Updated resource strings to reflect changes in controller shortcut instructions and diagnostics log actions.
… per il selettore di profili
- Implemented display mode selection logic in DisplayProfilesPage.xaml.cs, allowing users to switch between extending displays and using the primary display only. - Added functionality to identify active displays with an overlay showing their index for 3 seconds. - Improved profile management by introducing validation for profile names and ensuring at least one display is selected before saving a profile. - Refactored profile application logic to maintain the selected profile state and improve user feedback during operations. - Created a new Section control for better UI organization, encapsulating title, subtitle, and content areas. - Updated localization strings for better clarity and accessibility in the display profiles section.
…ent RPC_E_WRONG_THREAD errors
…t and UI components
…y configuration structures
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Nader alanzi (GHR-STEAM)
approved these changes
Oct 8, 2026
Author
|
@microsoft-github-policy-service agree |
Author
|
/azp run |
|
Commenter does not have sufficient privileges for PR 51103 in repo microsoft/PowerToys |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MonitorPower.Coreimplementation for Windows display topology discovery, profile persistence, validation, recovery, and applicationArchitecture
Settings is the primary built-in experience.
PowerToys.MonitorPower.Runtimeowns global activation and the quick selector. The standalone Command Palette extension is a complementary surface and does not register another global keyboard or controller listener.Both surfaces share profiles from
%LOCALAPPDATA%\MonitorPower\profilesand reuseMonitorPower.Core; display topology and persistence logic are not duplicated.Validation
tools\build\build.cmd -Platform x64 -Configuration Debug— passed, 0 errorsvstest.console.exe ...Settings.UI.UnitTests.dll /Tests:CommonLibTest.MonitorPowerTests /Platform:x64— 10/10 passedgit diff --check— passedNotes for review
Related to #48286.