diff options
| author | Tom Englund <tomenglund26@gmail.com> | 2024-08-12 19:19:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-12 18:19:03 +0100 |
| commit | 3fa6db1e7a7f5596f449ae12d0b45ff364d7f6f1 (patch) | |
| tree | fda33f86c4706dd151e4cb17908bee60f4434d0a /src/render/Renderer.cpp | |
| parent | d361fcbd85a92f0494c6d8ef0c63aad798df20a7 (diff) | |
core: fix data race and a unsigned int rollover (#7278)
* keybindmgr: avoid uint rollover on mouse keycode
mouse keycode is 0, and the switch case checks for 0 - 8 and rolls over,
just return early if keycode is 0.
* watchdog: avoid data races in watchdog
asan thread sanitizer reported data races in the watchdog from reading
and setting the bool variables make them std::atomic bools. also add a
atomic bool for the main thread to wait for to avoid data race when
reading the config values.
* hyprdebug: change non unicode character to name
asan created false positives and didnt like this bit, so for the sake of
easier debugging rename it to something unicode.
Diffstat (limited to 'src/render/Renderer.cpp')
| -rw-r--r-- | src/render/Renderer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index a2d5a95e..6bf6a761 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1395,15 +1395,15 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) { pMonitor->pendingFrame = false; - const float µs = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now() - renderStart).count() / 1000.f; - g_pDebugOverlay->renderData(pMonitor, µs); + const float durationUs = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now() - renderStart).count() / 1000.f; + g_pDebugOverlay->renderData(pMonitor, durationUs); if (*PDEBUGOVERLAY == 1) { if (pMonitor == g_pCompositor->m_vMonitors.front().get()) { - const float µsNoOverlay = µs - std::chrono::duration_cast<std::chrono::nanoseconds>(endRenderOverlay - renderStartOverlay).count() / 1000.f; - g_pDebugOverlay->renderDataNoOverlay(pMonitor, µsNoOverlay); + const float noOverlayUs = durationUs - std::chrono::duration_cast<std::chrono::nanoseconds>(endRenderOverlay - renderStartOverlay).count() / 1000.f; + g_pDebugOverlay->renderDataNoOverlay(pMonitor, noOverlayUs); } else { - g_pDebugOverlay->renderDataNoOverlay(pMonitor, µs); + g_pDebugOverlay->renderDataNoOverlay(pMonitor, durationUs); } } } |
