fix(launcher): steady 60fps cadence to stop VRR/G-Sync flicker

The idle repaint was 500ms (~2fps), below the G-Sync/FreeSync VRR floor, so the
panel ran low-framerate compensation and every hover/animation spiked then
dropped the rate — the swinging refresh rate makes VRR displays flicker. Present
at a constant ~60fps (16ms) instead so VRR locks to one rate. Cheap for a UI
this small; vsync keeps present times regular.
This commit is contained in:
funman300
2026-08-20 19:35:17 +00:00
parent 057cf92c3b
commit 6be75f5452
+9 -1
View File
@@ -1804,7 +1804,15 @@ impl LauncherApp {
impl eframe::App for LauncherApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
ctx.request_repaint_after(std::time::Duration::from_millis(500));
// Present at a steady ~60 FPS while the window is open. egui is normally
// reactive and would idle at ~2 FPS (a 500 ms repaint), but on a G-Sync /
// FreeSync (VRR) display that sits below the VRR floor: the panel engages
// low-framerate compensation, and every hover/animation briefly spikes the
// rate and drops back, so the refresh rate keeps swinging and the panel
// visibly flickers. A constant, in-range cadence gives VRR a single rate to
// lock onto and removes the flicker. 16 ms is monitor-independent and cheap
// for a UI this small; vsync (on by default) keeps present times regular.
ctx.request_repaint_after(std::time::Duration::from_millis(16));
self.drive_restart_queue();
egui::TopBottomPanel::top("header")