Fix advanced settings TDP limits not persisting across restarts#1387
Draft
Fix advanced settings TDP limits not persisting across restarts#1387
Conversation
In NumberBox_TDPMax_ValueChanged and NumberBox_TDPMin_ValueChanged, the in-memory cTDP was updated before calling SetProperty. SettingsManager's GetProperty falls back to IDevice.GetCurrent().cTDP[i] when the saved value is 0 or the toggle is off, so the freshly-updated cTDP made SetProperty see no change and skip the save entirely. Fix: call SetProperty before updating cTDP so the change is correctly detected and persisted. Also fix typos in PerformanceManager.SettingsManager_SettingValueChanged where the validation guards compared the existing static TDPMin/TDPMax fields against each other instead of comparing the incoming new value against the current limit. Co-authored-by: Valkirie <934757+Valkirie@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix advanced settings TDP limits not saving
Fix advanced settings TDP limits not persisting across restarts
Mar 16, 2026
Valkirie
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Custom TDP min/max limits set in Advanced Settings always reset to device defaults on restart. The saved values were never actually written to
Properties.Settings.Default.Root cause
NumberBox_TDPMax/Min_ValueChangedupdatedIDevice.GetCurrent().cTDP[i]before callingSetProperty.SettingsManager.GetPropertyfalls back tocTDP[i]when no value has been saved yet (default0) or when theConfigurableTDPOverridetoggle is off. WithcTDP[i]already holding the new value,SetProperty's change-detection sawprevValue == valueand returned early — never persisting anything.Changes
DevicePage.xaml.cs— Swapped order inNumberBox_TDPMax_ValueChangedandNumberBox_TDPMin_ValueChanged: callSetPropertybefore updatingcTDP[i].PerformanceManager.cs— Fixed typos inSettingsManager_SettingValueChangedvalidation guards: guards compared the existing staticTDPMin/TDPMaxfields against each other (always valid, so never rejected anything) instead of comparing the incomingTDPmin/TDPmaxagainst the current limit. This could allow an invalidTDPMin > TDPMaxstate to be set.Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.