fix: Steam's UI draws at an even share of the refresh near 60 fps instead of the panel's full rate (lag and heat since 0.6.7) (#1809)

This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-10-30 02:16:25 -04:00
1 parent b0a8c2065d
commit f69e2d0171
9 files changed
+92 -12

No files matched your search

@@ -51,10 +51,11 @@ object CompositorHost {
outputHeight: Int,
refreshHz: Float,
fpsLimit: Int,
uiLimit: Int = 0,
): Boolean {
ownVsyncThread = SessionPrefs.vsyncThread(context)
WaylandCompositor.nativeSetRenderOnCommit(SessionPrefs.renderOnCommit(context))
pace(refreshHz, fpsLimit)
pace(refreshHz, fpsLimit, uiLimit)
if (!SessionState.running) WaylandCompositor.nativeSetOutputSize(outputWidth, outputHeight)
if (started) {
attached = surface
@@ -72,16 +73,16 @@ object CompositorHost {
return true
}
private fun pace(refreshHz: Float, fpsLimit: Int) {
WaylandCompositor.nativeSetFpsLimit(fpsLimit)
private fun pace(refreshHz: Float, fpsLimit: Int, uiLimit: Int = 0) {
WaylandCompositor.nativeSetFpsLimit(if (fpsLimit == SessionPrefs.FPS_UNPACED && uiLimit > 0) uiLimit else fpsLimit)
WaylandCompositor.nativeSetLayerFrameRate(if (fpsLimit > 0) fpsLimit.toFloat() else refreshHz)
WaylandCompositor.nativeSetOutputRefreshRate(refreshHz)
SessionState.refreshHz = refreshHz
}
@Synchronized
fun updatePacing(refreshHz: Float, fpsLimit: Int) {
if (started) pace(refreshHz, fpsLimit)
fun updatePacing(refreshHz: Float, fpsLimit: Int, uiLimit: Int = 0) {
if (started) pace(refreshHz, fpsLimit, uiLimit)
}
@Synchronized