Skip to content

gui: make max FPS slider dynamic based on monitor refresh rate#3807

Open
eyadmkv wants to merge 3 commits into
CaffeineMC:devfrom
eyadmkv:feature/dynamic-fps-limit
Open

gui: make max FPS slider dynamic based on monitor refresh rate#3807
eyadmkv wants to merge 3 commits into
CaffeineMC:devfrom
eyadmkv:feature/dynamic-fps-limit

Conversation

@eyadmkv

@eyadmkv eyadmkv commented Jul 6, 2026

Copy link
Copy Markdown

Fixes #3781: Automatically calculate the slider's upper bound based on the current monitor's refresh rate, removing the static hardcoded cap and providing better support for high-refresh-rate displays

Fixes CaffeineMC#3781: Automatically calculate the slider's upper bound based on the current monitor's refresh rate, removing the static hardcoded cap and providing better support for high-refresh-rate displays.
Refactor the framerate limit calculation to be dynamic rather than static by extracting the refresh rate probing to getMaxFramerateLimit and utilizing setValidatorProvider; the FPS bounds now update in response to live state changes, mirroring the implementation used for gui_scale.

Additionally:
- Restore the accidentally removed Graphics API option group.
- Revert setValueFormatter to ControlValueFormatterImpls.fpsLimit().
- Added imports.
@eyadmkv

eyadmkv commented Jul 6, 2026

Copy link
Copy Markdown
Author

Hi @douira, thank you again for the feedback. I have pushed an update addressing the points you raised, I hope they meet your expectations!
FYI: The Graphics API being removed was an accident

);
generalPage.addOptionGroup(builder.createOptionGroup().addOption(builder.createEnumOption(Identifier.fromNamespaceAndPath("sodium", "general.graphics_api"),
PreferredGraphicsApi.class)
PreferredGraphicsApi.class)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please clean up the diff

@eyadmkv

eyadmkv commented Jul 6, 2026

Copy link
Copy Markdown
Author

Tell me if there's something wrong, I'm happy to learn from you!

@eyadmkv eyadmkv requested a review from douira July 6, 2026 19:30
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.

Increase max fps slider range

2 participants