diff options
author | Vaxry <[email protected]> | 2024-04-08 18:00:35 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-04-08 18:00:35 +0100 |
commit | 4d4e3f64ff93cfde69d8b6ded2865a7023a812ae (patch) | |
tree | 78cfe0f78ee457d3f3935f2d4acf5737384a89c6 | |
parent | 98635351416a5753a99d6baa1f7a0a24c813eeda (diff) | |
download | Hyprland-4d4e3f64ff93cfde69d8b6ded2865a7023a812ae.tar.gz Hyprland-4d4e3f64ff93cfde69d8b6ded2865a7023a812ae.zip |
-rw-r--r-- | src/managers/FrameSchedulingManager.cpp | 10 | ||||
-rw-r--r-- | src/managers/FrameSchedulingManager.hpp | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/managers/FrameSchedulingManager.cpp b/src/managers/FrameSchedulingManager.cpp index 2d02f82f..fd86a37b 100644 --- a/src/managers/FrameSchedulingManager.cpp +++ b/src/managers/FrameSchedulingManager.cpp @@ -4,7 +4,7 @@ #include "eventLoop/EventLoopManager.hpp" static void onPresentTimer(std::shared_ptr<CEventLoopTimer> self, void* data) { - g_pFrameSchedulingManager->onVblankTimer(data); + g_pFrameSchedulingManager->onVblankTimer((CMonitor*)data); } static void onFenceTimer(std::shared_ptr<CEventLoopTimer> self, void* data) { @@ -41,7 +41,7 @@ void CFrameSchedulingManager::registerMonitor(CMonitor* pMonitor) { #endif DATA->fenceTimer = std::make_shared<CEventLoopTimer>(::onFenceTimer, pMonitor); - DATA->vblankTimer = std::make_shared<CEventLoopTimer>(::onPresentTimer, DATA); + DATA->vblankTimer = std::make_shared<CEventLoopTimer>(::onPresentTimer, pMonitor); g_pEventLoopManager->addTimer(DATA->fenceTimer); g_pEventLoopManager->addTimer(DATA->vblankTimer); @@ -252,8 +252,10 @@ void CFrameSchedulingManager::renderMonitor(SSchedulingData* data) { data->rendered = true; } -void CFrameSchedulingManager::onVblankTimer(void* data) { - auto DATA = (SSchedulingData*)data; +void CFrameSchedulingManager::onVblankTimer(CMonitor* pMonitor) { + const auto DATA = dataFor(pMonitor); + + RASSERT(DATA, "No data in onVblankTimer"); if (!DATA->rendered) { // what the fuck? diff --git a/src/managers/FrameSchedulingManager.hpp b/src/managers/FrameSchedulingManager.hpp index dab00d77..1335bf7e 100644 --- a/src/managers/FrameSchedulingManager.hpp +++ b/src/managers/FrameSchedulingManager.hpp @@ -29,7 +29,7 @@ class CFrameSchedulingManager { void onPresent(CMonitor* pMonitor, wlr_output_event_present* presentationData); void onFrame(CMonitor* pMonitor); - void onVblankTimer(void* data); + void onVblankTimer(CMonitor* pMonitor); bool isMonitorUsingLegacyScheduler(CMonitor* pMonitor); |