core/renderloop: fix triple buffering hysteresis

The way it was implemented it only changed the target pageflip, but not the time at which
KWin would start compositing, which could make it skip scheduling a frame for each second
vblank and drop the refresh rate to half of what it should be that way

CCBUG: 488843
This commit is contained in:
Xaver Hugl 2024-07-24 20:15:24 +02:00
parent d12a93f9fb
commit d0f0481860

View file

@ -79,9 +79,11 @@ void RenderLoopPrivate::scheduleRepaint(std::chrono::nanoseconds lastTargetTimes
// also don't switch back if render times are just barely enough for double buffering
pageflipsInAdvance = 2;
doubleBufferingCounter = 0;
expectedCompositingTime = vblankInterval;
} else {
doubleBufferingCounter++;
pageflipsInAdvance = 2;
expectedCompositingTime = vblankInterval;
}
}