diff options
author | Tom Englund <[email protected]> | 2024-08-12 19:19:03 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-08-12 18:19:03 +0100 |
commit | 3fa6db1e7a7f5596f449ae12d0b45ff364d7f6f1 (patch) | |
tree | fda33f86c4706dd151e4cb17908bee60f4434d0a /src/debug/HyprDebugOverlay.cpp | |
parent | d361fcbd85a92f0494c6d8ef0c63aad798df20a7 (diff) | |
download | Hyprland-3fa6db1e7a7f5596f449ae12d0b45ff364d7f6f1.tar.gz Hyprland-3fa6db1e7a7f5596f449ae12d0b45ff364d7f6f1.zip |
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/debug/HyprDebugOverlay.cpp')
-rw-r--r-- | src/debug/HyprDebugOverlay.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/debug/HyprDebugOverlay.cpp b/src/debug/HyprDebugOverlay.cpp index 889be8ea..fbd8cd71 100644 --- a/src/debug/HyprDebugOverlay.cpp +++ b/src/debug/HyprDebugOverlay.cpp @@ -7,8 +7,8 @@ CHyprDebugOverlay::CHyprDebugOverlay() { m_pTexture = makeShared<CTexture>(); } -void CHyprMonitorDebugOverlay::renderData(CMonitor* pMonitor, float µs) { - m_dLastRenderTimes.push_back(µs / 1000.f); +void CHyprMonitorDebugOverlay::renderData(CMonitor* pMonitor, float durationUs) { + m_dLastRenderTimes.push_back(durationUs / 1000.f); if (m_dLastRenderTimes.size() > (long unsigned int)pMonitor->refreshRate) m_dLastRenderTimes.pop_front(); @@ -17,8 +17,8 @@ void CHyprMonitorDebugOverlay::renderData(CMonitor* pMonitor, float µs) { m_pMonitor = pMonitor; } -void CHyprMonitorDebugOverlay::renderDataNoOverlay(CMonitor* pMonitor, float µs) { - m_dLastRenderTimesNoOverlay.push_back(µs / 1000.f); +void CHyprMonitorDebugOverlay::renderDataNoOverlay(CMonitor* pMonitor, float durationUs) { + m_dLastRenderTimesNoOverlay.push_back(durationUs / 1000.f); if (m_dLastRenderTimesNoOverlay.size() > (long unsigned int)pMonitor->refreshRate) m_dLastRenderTimesNoOverlay.pop_front(); @@ -188,12 +188,12 @@ int CHyprMonitorDebugOverlay::draw(int offset) { return posY - offset; } -void CHyprDebugOverlay::renderData(CMonitor* pMonitor, float µs) { - m_mMonitorOverlays[pMonitor].renderData(pMonitor, µs); +void CHyprDebugOverlay::renderData(CMonitor* pMonitor, float durationUs) { + m_mMonitorOverlays[pMonitor].renderData(pMonitor, durationUs); } -void CHyprDebugOverlay::renderDataNoOverlay(CMonitor* pMonitor, float µs) { - m_mMonitorOverlays[pMonitor].renderDataNoOverlay(pMonitor, µs); +void CHyprDebugOverlay::renderDataNoOverlay(CMonitor* pMonitor, float durationUs) { + m_mMonitorOverlays[pMonitor].renderDataNoOverlay(pMonitor, durationUs); } void CHyprDebugOverlay::frameData(CMonitor* pMonitor) { |