mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-04 14:11:59 -07:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user