Skip to content

fps_limiter: keep the selected limit when switching presets - #2203

Open
JROtto5 wants to merge 1 commit into
flightlessmango:masterfrom
JROtto5:fix/2065-keep-fps-limit-on-preset
Open

JROtto5 wants to merge 1 commit into
flightlessmango:masterfrom
JROtto5:fix/2065-keep-fps-limit-on-preset

Conversation

@JROtto5

@JROtto5 JROtto5 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closes #2065.

toggle_preset recreates the fps limiter, so a limit picked with toggle_fps_limit went back to the first value. Keep its index when the new preset ends up with the same fps_limit list; a preset with a different list still starts at its first value, and reload_cfg still resets.

Tested with glxgears, preset=1,2, fps_limit=30,60: next limit, then next preset gives 30 -> 60 -> 30 on master, 30 -> 60 -> 60 here. With fps_limit=45 in preset 2 both give 30 -> 60 -> 45.

Switching presets reparses the config and creates a new fpsLimiter,
which always starts at the first fps_limit value. A limit picked with
toggle_fps_limit was lost on every toggle_preset press.

Carry the limiter's index over when the new preset ends up with the
same fps_limit list. A preset with a different fps_limit list still
starts at its first value, and reload_cfg still resets as before.

Fixes flightlessmango#2065

@fxzzi fxzzi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was a very minor gripe i had with mangohud, this fixes it. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Fps limit gets reset between presets.

2 participants