GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add numeric framerate limit input by Riqqqque · Pull Request #3632 · CaffeineMC/sodium

Conversation

@Riqqqque

@Riqqqque Riqqqque commented May 6, 2026

Copy link
Copy Markdown

Closes #3556.

Adds a numeric input for the framerate limit so exact caps can be entered instead of being limited to 10 FPS slider steps.

Changes:

  • uses a text box for Sodium's framerate limit option
  • replaces Minecraft's framerate limit option with an exact integer range before options are loaded
  • keeps the existing Sodium apply/save flow

The standalone addon this was ported from is Unlicense.

Validation:

  • ./gradlew.bat build
  • ./gradlew.bat :common:compileJava :fabric:compileJava :neoforge:compileJava --rerun-tasks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Felix14-v2 reacted with eyes emoji
All reactions
  • 👀 1 reaction
douira
douira requested changes May 6, 2026
View reviewed changes

@douira douira left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

If you don't have a suggestion for changes to the API to accomodate a second type of integer option, I can also do that myself during merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread common/src/main/java/net/caffeinemc/mods/sodium/client/config/structure/IntegerOption.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...c/main/java/net/caffeinemc/mods/sodium/client/gui/options/control/IntegerTextBoxControl.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread common/src/main/java/net/caffeinemc/mods/sodium/client/gui/options/FramerateLimit.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...n/src/main/java/net/caffeinemc/mods/sodium/mixin/features/gui/FramerateLimitOptionMixin.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

douira
douira requested changes May 7, 2026
View reviewed changes

@douira douira left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I've pushed some changes to this branch to clean up some things, faster than going back and forth here.

  • However, I've noticed that once I enter a number into the text field, it doesn't let me change it.
  • Focusing it by keyboard navigation works, but it doesn't let me enter text
  • In the video the reset button shows up sometimes, but that's just because pressing shift + tab activates it because of the shift key
  • Clicking on the text field doesn't activate the cursor once it's been used
  • When the text field is activated and there's an outline around the option, the outlines touch which is not nice
  • The text in the textbox seems to be around 1-2 pixels too high and not vertically centered
output.mp4

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Riqqqque

Riqqqque commented May 8, 2026

Copy link
Copy Markdown
Author

Pushed a fix for the textbox focus/click handling and tightened the textbox height/vertical positioning.

Checked with:

  • ./gradlew.bat :common:compileJava :fabric:compileJava :neoforge:compileJava --rerun-tasks
  • ./gradlew.bat build
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Riqqqque

Riqqqque commented May 8, 2026

Copy link
Copy Markdown
Author

Added one more follow-up for the textbox behavior.

Tab focus now routes input to the actual text field, so typing/backspace should work instead of only showing the cursor. The click focus, focus-out commit, and spacing tweaks are still in place.

Checked with:

  • ./gradlew.bat :common:compileJava :fabric:compileJava :neoforge:compileJava --rerun-tasks
  • ./gradlew.bat build
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

douira
douira requested changes May 8, 2026
View reviewed changes

@douira douira left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It seems to work now but I'm somewhat confused why we need dragging. This flag doesn't seem to be doing anything. Maybe it would be appropriate to instead implement AbstractParentWidget rather than reimplementing a bunch of its code?
Thanks for improving this patch thus far!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...c/main/java/net/caffeinemc/mods/sodium/client/gui/options/control/IntegerTextBoxControl.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Riqqqque

Riqqqque commented May 9, 2026

Copy link
Copy Markdown
Author

Cleaned up the textbox focus handling.

ControlElement now has the parent-widget focus support, and the textbox registers its EditBox as a child instead of carrying its own focused-child/dragging state. The textbox control only keeps the focus-out commit hook now.

Checked with:

  • ./gradlew.bat :common:compileJava :fabric:compileJava :neoforge:compileJava --rerun-tasks
  • ./gradlew.bat build
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CoolAtlantis

CoolAtlantis commented Jul 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Yea, we need this! I play with VRR and i would like to have my framerate capped exactly at 177fps. I currently use a mod which makes the slider go by steps of 1 instead of 10. But having an input box built in to sodium itself, sounds awesome.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jellysquid3 jellysquid3 added the T-enhancement Type: Enhancement label Jul 12, 2026
@douira
douira force-pushed the rique/custom-fps-cap branch from 9af86f1 to c0a05a4 Compare July 27, 2026 13:41
douira
douira requested changes Jul 27, 2026
View reviewed changes

@douira douira left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It appears that tab navigation between options is broken on this branch.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Riqqqque

Riqqqque commented Jul 27, 2026

Copy link
Copy Markdown
Author

Fixed the tab navigation issue. Normal option controls were returning their own focus path even while already focused, so Tab kept selecting the same option. The fallback now only returns the control when it is not already focused; controls with children still use parent traversal.

Checked with:

  • ./gradlew.bat :common:compileJava :fabric:compileJava :neoforge:compileJava --rerun-tasks --console=plain
  • ./gradlew.bat build --console=plain

Commit: 1db98b99

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@douira douira mentioned this pull request Aug 24, 2026
gui: make max FPS slider dynamic based on monitor refresh rate #3807
Open
Riqqqque and others added 8 commits August 27, 2026 20:56
@Riqqqque
Add numeric framerate limit input
155726a
@Riqqqque
Expose integer text box controls
212f8dd
@douira @Riqqqque
Clean up some things
cc02fd1
@Riqqqque
Fix integer text box focus
a75d965
@Riqqqque
Fix integer textbox focus routing
21e8f39
@Riqqqque
Clean up integer textbox focus handling
b75ec77
@douira @Riqqqque
resolve build issues after rebase
c32f882
@Riqqqque
Fix option tab navigation
dbeb597
@Riqqqque
Riqqqque force-pushed the rique/custom-fps-cap branch from 1db98b9 to dbeb597 Compare August 28, 2026 03:00
@Riqqqque

Riqqqque commented Aug 28, 2026

Copy link
Copy Markdown
Author

Rebased onto current dev. Tab navigation fix is still in.

Checked with:

  • ./gradlew.bat :common:compileJava :fabric:compileJava :neoforge:compileJava --rerun-tasks --console=plain
  • ./gradlew.bat build --console=plain
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This branch has not been deployed

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

Reviewers

@douira douira douira requested changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

T-enhancement Type: Enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Replace the framerate slider with a numeric input for custom FPS caps

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Riqqqque @CoolAtlantis @douira @jellysquid3
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.