[client] overlay: initialize ImGui frame timing
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / idd (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run

Initialize the previous ImGui frame timestamp before rendering
overlays. Without this, the first DeltaTime equals host uptime.

Recent ImGui versions track background and foreground draw-list
activity using float time. At long host uptimes its precision can span
multiple display frames, preventing those lists from being reset and
submitting translucent overlay commands more than once.
This commit is contained in:
Geoffrey McRae
2026-08-09 15:07:15 +10:00
parent 89f0311abc
commit 40d6342d46

View File

@@ -962,6 +962,10 @@ void app_initOverlays(void)
}
}
ll_unlock(g_state.overlays);
/* Do not seed ImGui's clock with absolute host uptime. ImGui stores the
* background and foreground draw-list activity time as a float. */
g_state.lastImGuiFrame = nanotime();
}
static inline void mergeRect(struct Rect * dest, const struct Rect * a, const struct Rect * b)