feat(display): Add revert display config on disconnect option (#3613)

This commit is contained in:
VMFortress 2025-01-30 16:02:22 -05:00 committed by GitHub
commit 5b36357133
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 46 additions and 0 deletions

View file

@ -1882,11 +1882,17 @@ namespace stream {
// If this is the last session, invoke the platform callbacks
if (--running_sessions == 0) {
bool revert_display_config {config::video.dd.config_revert_on_disconnect};
if (proc::proc.running()) {
#if defined SUNSHINE_TRAY && SUNSHINE_TRAY >= 1
system_tray::update_tray_pausing(proc::proc.get_last_run_app_name());
#endif
} else {
// We have no app running and also no clients anymore.
revert_display_config = true;
}
if (revert_display_config) {
display_device::revert_configuration();
}