-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Add non-updating mode for Crop-And-Lock #40720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check-spelling found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
This comment has been minimized.
This comment has been minimized.
20d4c2e
to
3e5ca9e
Compare
This comment has been minimized.
This comment has been minimized.
b37eff3
to
af5b785
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new "screenshot" mode to the Crop and Lock utility, allowing users to create a static, non-updating snapshot of a cropped window area. This complements the existing reparent and thumbnail modes by providing a frozen copy of the selected window region.
Key changes:
- Adds new screenshot mode functionality with Win+Ctrl+Shift+S hotkey
- Implements ScreenshotCropAndLockWindow class for capturing and displaying static screenshots
- Updates settings UI to configure the new screenshot hotkey
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/settings-ui/Settings.UI/ViewModels/CropAndLockViewModel.cs | Adds ScreenshotActivationShortcut property to support configuring the screenshot hotkey |
src/settings-ui/Settings.UI/Strings/en-us/Resources.resw | Adds localization strings for screenshot mode UI elements |
src/settings-ui/Settings.UI/SettingsXAML/Views/CropAndLockPage.xaml | Adds UI control for screenshot hotkey configuration |
src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeCropAndLock.xaml | Adds screenshot hotkey display to onboarding experience |
src/settings-ui/Settings.UI/Library/CropAndLockProperties.cs | Defines default screenshot hotkey and properties |
src/modules/CropAndLock/CropAndLockModuleInterface/dllmain.cpp | Adds screenshot hotkey handling and event processing |
src/modules/CropAndLock/CropAndLock/trace.h | Adds telemetry support for screenshot mode |
src/modules/CropAndLock/CropAndLock/main.cpp | Implements screenshot event handling and window creation |
src/modules/CropAndLock/CropAndLock/ScreenshotCropAndLockWindow.h | Header for new screenshot window implementation |
src/modules/CropAndLock/CropAndLock/ScreenshotCropAndLockWindow.cpp | Core implementation of screenshot capturing and display |
src/common/interop/shared_constants.h | Adds screenshot event constant for IPC communication |
doc/devdocs/modules/cropandlock.md | Updates documentation to include screenshot mode |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
/azp run |
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
There is a new Conflict Detection added, need to update accordingly: |
# Conflicts: # src/settings-ui/Settings.UI/Strings/en-us/Resources.resw
…op-and-lock # Conflicts: # src/settings-ui/Settings.UI/Strings/en-us/Resources.resw
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi @yeelam-gordon, anything which needs to be done from my side? |
Summary of the Pull Request
Adds a "screenshot" mode to Crop And Lock, which allows creating a window showing a freezed snapshot of the original window.
PR Checklist
Detailed Description of the Pull Request / Additional comments
It was asked why this feature is needed at all, because it could be done with snipping tool and just AoT that window as well. While this is true, PowerToys goal always was to improve and speed up workflows. Instead of capturing the screenshot, opening it, and then apply "Crop and Lock" or "Always on Top" on the screenshots window, this PR aims to provide this functionality in a single step.
Example use cases:
I've used win+ctrl+shift+s as the default activation shortcut, as it's not yet used by other powertoys utilities, has similarity with the normal win+shift+s shortcut hotkey and is consistent with the other Crop and Lock shortcuts win+ctrl+shift+r (Reparent Mode) and win+ctrl+shift+t (Thumbnail Mode).
Validation Steps Performed
Compatibility tested manually with a large set of applications I have installed on my computer. However, automated tests don't really make sense as there is not much business logic which could be tested.