Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto detect background image (#7849)
## Summary of the Pull Request Added watch on desktopImagePath to check when the path equals "DesktopWallpaper" If it does equal "DesktopWallpaper" it replaces the path with a path to the desktop's wallpaper *I am a student and this is my first pull request for Terminal so please give feedback no matter how small. It's the best way I can learn. ## PR Checklist * [X] Closes #7295 * [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [?] Tests added/passed * [X] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: MicrosoftDocs/terminal#155 * [?] Schema updated. (Not sure if this is needed, also not sure where this would be) * [X] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #7295 (Have only talked with the people on the issue, which I don't think has any core contributors) ## Detailed Description of the Pull Request / Additional comments I am using SystemParametersInfo for SPI_GETDESKWALLPAPER which puts the path into a WCHAR and that is then inserted as the BackgroundImagePath. I do not think an additional test would add value. The SPI_GETDESKTOPWALLPAPER uses the computers local wallpaper path and puts it into a WCHAR, which then I feed into BackgroundImagePath() as it's new path. I don't think there adds value in making a static path of the desktop background and testing that, given that static tests are already done for "BackgroundImage()". ## Validation Steps Performed (Manual Validation - Test False Value) 1. Ran Terminal 2. Set setting ["backgroundImage": "<some random img path>"] under profiles->defaults 3. Verified terminal's background is not the desktops wallpaper. (Manual Validation - Test True Value) 1. Ran Terminal 2. Set setting ["backgroundImage": "DesktopWallpaper"] under profiles->defaults 3. Verified the background image matches the desktop background image. (Manual Validation - Multiple Tabs True Value) 1. Ran Terminal 2. Set setting ["backgroundImage": "DesktopWallpaper"] under profiles->defaults 3. Verified the background image matches the desktop background image. 4. Opened new tabs 5. Verified the background image matches the desktop background image for each tab.
- Loading branch information