Skip to content

feat: clamp cursor repaints to adaptive sync framerate#2084

Open
njdom24 wants to merge 1 commit into
ValveSoftware:masterfrom
njdom24:vrr-cursor-clamp
Open

feat: clamp cursor repaints to adaptive sync framerate#2084
njdom24 wants to merge 1 commit into
ValveSoftware:masterfrom
njdom24:vrr-cursor-clamp

Conversation

@njdom24

@njdom24 njdom24 commented Feb 12, 2026

Copy link
Copy Markdown

Following the idea from #1562, adds an --adaptive-sync-ignore-cursor option to clamp cursor updates to a game's refresh rate, preventing VRR from shooting to the max refresh rate on cursor movement.

Follows the pattern used by adaptive_sync_ignore_overlay ConVar.

Tested using the Wayland backend with Final Fantasy XIV. It has a built-in software cursor, but this method is much more responsive.

@matte-schwartz

Copy link
Copy Markdown

thanks for taking a crack at this, I'm on vacation at the moment but I will try and test it at some point soon.

@alosarjos

Copy link
Copy Markdown

Would this MR fix my issues where, if running a game on gamescope embedded mode and adaptive sync enabled, whenever I move the cursor, the refresh rate goes to the max the monitor allows?

@matte-schwartz

Copy link
Copy Markdown

@alosarjos that's the intention, yes

@alosarjos

alosarjos commented Mar 27, 2026

Copy link
Copy Markdown

Oh amazing! I was struggling with this issue, since this trigger horrible brightness flickering on OLED monitors whenever I moved the cursor.. Thanks for clarifying it @matte-schwartz :D

@alosarjos

Copy link
Copy Markdown

I've tried with this command:

gamescope -W 3840 -H 2160 --hdr-enabled --fullscreen --backend wayland --adaptive-sync --adaptive-sync-ignore-cursor --mangoapp -- %command%

But it's not working for me, am I doing something wrong?

@njdom24

njdom24 commented Mar 28, 2026

Copy link
Copy Markdown
Author

@alosarjos You may need to add --force-grab-cursor to put cursor composition in Gamescope's control. Otherwise, cursor updates would be determined by your compositor.

Don't think there's anything I could do about that, but I'd love to be wrong.

@alosarjos

Copy link
Copy Markdown

@njdom24 Thanks a lot! Yeahp, look like that did the trick! Now mouse movement is following the game framerate and working nicely.

I see there is still some kind of issue where "clicking" is making the screen refresh rate jump, but only clicking not moving, so this PR is working fine for me :D

@njdom24

njdom24 commented Mar 30, 2026

Copy link
Copy Markdown
Author

I see there is still some kind of issue where "clicking" is making the screen refresh rate jump, but only clicking not moving

@alosarjos Does this happen consistently? I'm not able to see this on Sway. Tested doing menu navigation with Elden Ring Nightreign, which I capped at 60 (better than its built-in FPS limiter for VRR) with MANGOHUD_CONFIG="read_cfg,fps_limit=60" .

@alosarjos

Copy link
Copy Markdown

Video is not very good. But I think you can see it better on the second half of it. This is an OLED monitor, so when refresh rate jumps too fast, the brightness flickers.

But not 100% sure on reproducibility, I got it first time, then I restarted game 3 times, and on the last one happened again.

One curious thing tho, on the other clicking wasn't flickering, but there was this kind of time interval where the screen would go to the max refresh rate for a moment, in a very timed way.

The only other game with HDR to see clearly the flickering is Kingdom Come Deliverance 2. I don't see any issue there (There is no cursor). But maybe it's a red herring and nothing to do with this.

video.mp4

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.

3 participants