microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.78k stars 319 forks source link

UWP apps should be suspended even if they aren't minimised #1487

Open JaiganeshKumaran opened 2 years ago

JaiganeshKumaran commented 2 years ago

Proposal: UWP apps should be suspended even if they aren't minimised

Today an UWP app gets suspended when minimised. However if you switch to an another application without minimising the current one, it won't get suspended as the system treats it as running. This does make sense when the app is snapped or shown along side others in non-maximised window, however when each of the app window is maximised, from the users point of view, it's not used at the time.

Summary

Consider suspended apps even if their windows aren't minimised as long as no pixel from the window is displayed on any of the connected displays.

Rationale

Scope

Capability Priority
This proposal will allow end users to switch between apps quickly and the system will save resources by suspended unused apps Should
riverar commented 2 years ago

What do you propose happens when the app receives a message, e.g. when OS colors change?

AzAgarampur commented 2 years ago

The same thing that happens when the app is minimized, probably. For example, if App A's CurrentTheme is Dark and it is minimized & suspended, and the user changes the App color theme in settings to Light, then App A will remain in Dark until it is resumed, then it changes to Light.

Also by suspended I'm assuming you mean frozen via deep-freeze.

riverar commented 2 years ago

That's not really an answer to my question, but it sounds like you're suggesting that windows on-screen should remain Light during a Light to Dark transition. You can see how that may be a problem.

AzAgarampur commented 2 years ago

By message do you mean from the message loop, like WM_SETTINGCHANGE? Also the original comment says

as no pixel from the window is displayed on any of the connected displays.

riverar commented 2 years ago

Yeah, WM_SETTINGCHANGE is a good example. I missed the no-pixel-shown requirement, thanks. I'm curious about the user scenario that involves UWP apps that appear off-screen and have a desire to be suspended.

AzAgarampur commented 2 years ago

I can see something like a DirectX-heavy app like a fps game being used. The user would drag a few windows over it and go do another task for a bit, and the game can be suspended so overall cpu/gpu load is reduced.

I can see how this can be a problem, if they want for example, music from the app to keep temporarily playing. In that case, an way for an app to opt-out of this "invisibility suspend" can be added via a manifest or something.

JaiganeshKumaran commented 2 years ago

I can see how this can be a problem, if they want for example, music from the app to keep temporarily playing. In that case, an way for an app to opt-out of this "invisibility suspend" can be added via a manifest or something.

Apps that play audio should use background playback that works even when the app is suspended.

ghost commented 2 years ago

@andrewleader @btueffers this issue should be closed for the same reason (CoreWindow) #159 #173 #302 got closed.

JaiganeshKumaran commented 2 years ago

@andrewleader @btueffers this issue should be closed for the same reason (CoreWindow) #159 #173 #302 got closed.

No because it isn't CoreWindow specific.