WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

Add methods to UserProfilePersonalizationSettings for retrieving lock screen and desktop background

Open jaigak opened this issue 4 years ago • 17 comments

Proposal: Add methods to UserProfilePersonalizationSettings for retrieving lock screen and desktop backgrounds

Today UserProfilePersonalizationSettings has methods to set the lock screen and desktop background asynchronously. I understand that getting the current wallpaper could violate privacy however some customization apps may need to access the lock screen/desktop background to do their job.

Summary

To methods TryGetLockScreenImageAsync and TryGetWallpaperImageAsync could be added to Windows.System.UserProfile.UserProfilePersonalizationSettings. Since this is privacy sensitive, Windows could show a dialog box asking the user whether the user wants to allow the app to access the lock screen/desktop background once. Instead of a permission or a capability, this can be asked every time the app calls the API.

Rationale

  • More opportunity for developers writing apps that target the app container

Scope

Capability Priority
This proposal will allow developers to access desktop/lockscreen background while being inside a low IL process Must
This proposal will allow end users to let apps access their desktop/lockscreen background Should
This proposal will allow developers to access desktop/lockscreen background silently Won't

Important Notes

Same dialog should be shown when the API is accessed from unpackaged apps although those kinds of apps can use old Win32 APIs to achieve the same which won't show the consent dialog.

Open Questions

jaigak avatar Mar 30 '21 14:03 jaigak

There is no violation of privacy in a contract based security model. They simply need to add the alert to the application contract. And no dialog is required. Upon installation, the user agrees to the application's access to personalization data such as background image.

Gavin-Williams avatar Apr 01 '21 23:04 Gavin-Williams

Our pattern of declared capability (in the app manifest) and runtime use (the Request...) apis lets the user know that an app might ask for a power, and makes it clear when the app is asserting that power. Adding the APIs you suggest is interesting, but it'd be behind a combination of those two. The first time the app wants to use the power, the system asks the user - "is it OK for this app to change your background?" and there should be an "always" option so the user is never prompted again. (Although the app needs to Request... each time, subsequent requests may not actually pop the dialog if the user said "always.")

jonwis avatar Apr 02 '21 04:04 jonwis

@Jaiganeshkumaran , can you briefly describe a hypothetical app that would get the user's lockscreen/background images, and what the app would want to do with those? You mention personalization, can you elaborate?

jonwis avatar Apr 02 '21 04:04 jonwis

Theoretical app could provide additional features such as daily rotating imagery from a custom source, imagery that changes with day/night cycle, or even other triggers like ProjectReunion CI build failures.

Theoretical app could appear as such: image

riverar avatar Apr 02 '21 08:04 riverar

An example of what this feature or capability can be used for: acrylic wallpaper tinting like in MacOS So you would request the wallpaper -> get the dominant color -> cache it -> set it as the acrylic tint color

So in this example it would be nice to have a wallpaper change event too

ahmed605 avatar Apr 02 '21 09:04 ahmed605

See also windows Dynamic Theme store app.

tbolon avatar Apr 06 '21 11:04 tbolon

We need this now

FireCubeStudios avatar Jul 04 '21 20:07 FireCubeStudios

I request this functionality be added with Windows 10 support too

FireCubeStudios avatar Jul 04 '21 20:07 FireCubeStudios

@Jaiganeshkumaran , can you briefly describe a hypothetical app that would get the user's lockscreen/background images, and what the app would want to do with those? You mention personalization, can you elaborate?

I would use to get wallpaper colors to achieve similair things to this https://twitter.com/LunaNeither/status/1397603160567468042

FireCubeStudios avatar Jul 04 '21 22:07 FireCubeStudios

Why not simply just use Winaero Tweaker to extract the images?

JuliaAgostino avatar Jul 05 '21 12:07 JuliaAgostino

Why not simply just use Winaero Tweaker to extract the images?

You can't do that programmatically in your UWP app. Also, Winaero Tweaker is a Win32 desktop app that reads from the registry which a UWP app can't do that easily except its own private hive (Local storage, roaming storage etc...)

jaigak avatar Jul 08 '21 02:07 jaigak

Part Of:

  • #8.

  • #219.

mominshaikhdevs avatar Jun 19 '25 02:06 mominshaikhdevs

@mominshaikhdevs Do you work at Microsoft? Why are you adding these comments to various issues in the repository?

riverar avatar Jun 19 '25 04:06 riverar

@mominshaikhdevs Do you work at Microsoft? Why are you adding these comments to various issues in the repository?

It's obvious that I don't. Opening issues doesn't require "working at microsoft" so is the same as linking issues.

mominshaikhdevs avatar Jun 19 '25 04:06 mominshaikhdevs

BTW, there is LockScreen Class and IDesktopWallpaper interface

castorix avatar Jun 19 '25 05:06 castorix

@mominshaikhdevs It wasn't obvious to me or I wouldn't have asked. I would appreciate if you stop adding a bunch of noise to the issues in this repository.

riverar avatar Jun 19 '25 05:06 riverar

@mominshaikhdevs ...a bunch of noise...

I disagree with your perception of "a bunch of noise". I would appreciate too if you do the reverse.

mominshaikhdevs avatar Jun 19 '25 05:06 mominshaikhdevs