Repository navigation
[ZoomIt] Add DemoMirror feature - #49607
Merged
Merged
Conversation
Mirror the screen, a selected region (Shift), or the window under the cursor (Alt) onto a second monitor - including the mouse pointer - so a demo can be shown on a presentation display without leaving the current view. Adds the native MirrorWindow implementation, a DemoMirror options tab (Ctrl+9 default, plus Track window region), and the corresponding Settings UI (ZoomIt page group, view model, properties, and resources).
chakrik73
requested review from
Mario Hewardt (MarioHewardt),
Copilot and
Alex Mihaiuc (foxmsft)
August 1, 2026 00:47
Mario Hewardt (MarioHewardt)
approved these changes
Aug 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new DemoMirror capability to the ZoomIt module, enabling mirroring of a full screen, selected region, or window-under-cursor onto a second monitor (including cursor), and wires the required settings through the WinUI Settings UI and the native ZoomIt settings/interop pipeline.
Changes:
- Implemented native mirror rendering/capture via new
MirrorWindow(Windows.Graphics.Capture + D3D11 swapchain) and integrated start/stop + hotkey registration intoZoomit.cpp. - Extended ZoomIt settings (native registry-backed + interop JSON + Settings UI view model/properties) with
MirrorToggleKeyandMirrorTrackWindow. - Added Settings UI XAML + localized strings for the new DemoMirror settings group, and updated native options dialog resources.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/settings-ui/Settings.UI/ViewModels/ZoomItViewModel.cs | Adds DemoMirror hotkey + derived Shift/Alt variants and Track Window setting bindings. |
| src/settings-ui/Settings.UI/Strings/en-us/Resources.resw | Adds localized strings for the new DemoMirror settings group. |
| src/settings-ui/Settings.UI/SettingsXAML/Views/ZoomItPage.xaml | Adds a DemoMirror settings group UI (hotkey + track window checkbox + shortcut descriptions). |
| src/settings-ui/Settings.UI.Library/ZoomItProperties.cs | Adds default mirror hotkey and new properties (MirrorToggleKey, MirrorTrackWindow). |
| src/modules/ZoomIt/ZoomItSettingsInterop/ZoomItSettings.cpp | Adds special-semantics handling for MirrorToggleKey serialization/deserialization. |
| src/modules/ZoomIt/ZoomIt/ZoomItSettings.h | Adds new registry-backed settings entries for mirror hotkey and track-window behavior. |
| src/modules/ZoomIt/ZoomIt/ZoomIt.vcxproj.filters | Registers new MirrorWindow source/header in VS filters. |
| src/modules/ZoomIt/ZoomIt/ZoomIt.vcxproj | Includes new MirrorWindow compilation units in the project. |
| src/modules/ZoomIt/ZoomIt/ZoomIt.rc | Adds a native DemoMirror options dialog resource and layout entries. |
| src/modules/ZoomIt/ZoomIt/Zoomit.cpp | Integrates DemoMirror hotkeys, options UI plumbing, and mirror start/stop control flow. |
| src/modules/ZoomIt/ZoomIt/SelectRectangle.h | Adds a border-color setter and new member state for selection border behavior. |
| src/modules/ZoomIt/ZoomIt/SelectRectangle.cpp | Adjusts selection border reset behavior on Start for mirror/panorama flows. |
| src/modules/ZoomIt/ZoomIt/resource.h | Adds new control IDs for the DemoMirror options UI. |
| src/modules/ZoomIt/ZoomIt/MirrorWindow.h | Declares the MirrorWindow capture/render window and related constants/messages. |
| src/modules/ZoomIt/ZoomIt/MirrorWindow.cpp | Implements capture, cursor inclusion, window/monitor switching during annotations, and rendering/presentation loop. |
| src/modules/ZoomIt/ZoomIt/CaptureFrameWait.h | Extends CaptureFrameWait to support suppressing system capture borders and recreating the frame pool. |
| src/modules/ZoomIt/ZoomIt/CaptureFrameWait.cpp | Implements the new CaptureFrameWait constructor behavior (border suppression). |
Suppressed comments (1)
src/modules/ZoomIt/ZoomIt/SelectRectangle.h:53
m_configuredBorderColoris currently unused (no reads), which adds dead state and can confuse future changes. Removing it keeps the class state minimal.
COLORREF m_borderColor = RGB( 255, 222, 0 ); // default: yellow (matches capture API)
COLORREF m_configuredBorderColor = RGB( 255, 222, 0 ); // color Start resets to
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.
Mirror the screen, a selected region (Shift), or the window under the cursor (Alt) onto a second monitor - including the mouse pointer - so a demo can be shown on a presentation display without leaving the current view. Adds the native MirrorWindow implementation, a DemoMirror options tab (Ctrl+9 default, plus Track window region), and the corresponding Settings UI (ZoomIt page group, view model, properties, and resources).
Summary of the Pull Request
Adds a DemoMirror feature to ZoomIt. It mirrors the screen, a selected region (Shift), or the window under the cursor (Alt) onto a second monitor — including the mouse pointer — so a demo can be shown on a presentation display without leaving the current view.
This introduces the native
MirrorWindowimplementation, a new DemoMirror options tab (default hotkey Ctrl+9, plus a Track window region option), and the corresponding Settings UI wiring (ZoomIt page group, view model, properties, and localized resources).PR Checklist
Detailed Description of the Pull Request / Additional comments
DemoMirror lets a presenter keep working on their primary display while a second monitor shows a live mirror of a chosen source. Three capture modes are supported via the DemoMirror hotkey (default Ctrl+9):
Ctrl+9: mirrors the entire source screen.Ctrl+Shift+9: mirrors a user-selected rectangular region.Ctrl+Alt+9: mirrors the window currently under the cursor. With the Track window region option enabled, the mirror follows the window as it moves/resizes.The mirror includes the mouse pointer so pointer movement and clicks are visible on the presentation display.
Native (C++ /
PowerToys.ZoomIt.exe)MirrorWindow.cpp/MirrorWindow.himplementing the mirror capture/render window. Mirror windows useWS_EX_NOACTIVATE | WS_EX_TRANSPARENTso they never steal focus from the source.Zoomit.cpp: registers the DemoMirror hotkeys and wires the start/stop handlers; the stop path checksg_MirrorWindow.IsActive()and stops unconditionally (cursor-independent).ZoomItSettings.h: newMirrorToggleKey(defaultCtrl+9) andMirrorTrackWindowsettings, added to theRegSettings[]table. Record default kept distinct atCtrl+5.resource.h/ZoomIt.rc: new DemoMirror options tab and controls (IDC_MIRROR_HOTKEY,IDC_MIRROR_TRACK_WINDOW).CaptureFrameWait.*andSelectRectangle.*updated to support the mirror capture/selection flow.ZoomItSettingsInterop/ZoomItSettings.cpp: exposes the new settings across the interop bridge.Settings UI (WinUI 3)
ZoomItPage.xaml), backed byZoomItViewModel.csandZoomItProperties.cs.Resources.resw.Conflict resolution notes (rebased on top of upstream
main):IDC_MIRROR_HOTKEY,IDC_MIRROR_TRACK_WINDOW).SelectRectangleborder-color: kept upstreamm_borderColor = borderColor;.WM_USERmessage-ID collision resolved by usingWM_USER_MIRROR_STOP = WM_USER + 113.Validation Steps Performed
Manually validated on a real dual-display setup (Surface laptop extended to an external monitor):
Ctrl+9): source screen mirrored to the second monitor, including the mouse pointer.Ctrl+Shift+9): selected region mirrored correctly.Ctrl+Alt+9): window under the cursor mirrored; with Track window region enabled, the mirror follows the window.WS_EX_NOACTIVATE | WS_EX_TRANSPARENT).Ctrl+5) and DemoMirror (Ctrl+9) defaults are distinct and read independently from their own registry/settings values (no cross-contamination).