fix: use stl's clock like hl

877fb5b93a
This commit is contained in:
Virt 2025-04-16 21:45:43 +02:00
commit 34b5fca47b
4 changed files with 6 additions and 4 deletions

1
.gitignore vendored
View file

@ -3,3 +3,4 @@ compile_commands.events.json
out out
.cache .cache
result result
notes.md

View file

@ -60,7 +60,7 @@ CDynamicCursors::~CDynamicCursors() {
Reimplements rendering of the software cursor. Reimplements rendering of the software cursor.
Is also largely identical to hyprlands impl, but uses our custom rendering to rotate the cursor. Is also largely identical to hyprlands impl, but uses our custom rendering to rotate the cursor.
*/ */
void CDynamicCursors::renderSoftware(CPointerManager* pointers, SP<CMonitor> pMonitor, timespec* now, CRegion& damage, std::optional<Vector2D> overridePos) { void CDynamicCursors::renderSoftware(CPointerManager* pointers, SP<CMonitor> pMonitor, const Time::steady_tp& now, CRegion& damage, std::optional<Vector2D> overridePos) {
static auto* const* PNEAREST = (Hyprlang::INT* const*) getConfig(CONFIG_HIGHRES_NEAREST); static auto* const* PNEAREST = (Hyprlang::INT* const*) getConfig(CONFIG_HIGHRES_NEAREST);
if (!pointers->hasCursor()) if (!pointers->hasCursor())

View file

@ -25,7 +25,7 @@ class CDynamicCursors {
void onTick(CPointerManager* pointers); void onTick(CPointerManager* pointers);
/* hook on renderSoftwareCursorsFor */ /* hook on renderSoftwareCursorsFor */
void renderSoftware(CPointerManager* pointers, SP<CMonitor> pMonitor, timespec* now, CRegion& damage, std::optional<Vector2D> overridePos); void renderSoftware(CPointerManager* pointers, SP<CMonitor> pMonitor, const Time::steady_tp& now, CRegion& damage, std::optional<Vector2D> overridePos);
/* hook on damageIfSoftware*/ /* hook on damageIfSoftware*/
void damageSoftware(CPointerManager* pointers); void damageSoftware(CPointerManager* pointers);
/* hook on renderHWCursorBuffer */ /* hook on renderHWCursorBuffer */

View file

@ -12,13 +12,14 @@
#include "globals.hpp" #include "globals.hpp"
#include "cursor.hpp" #include "cursor.hpp"
#include "config/config.hpp" #include "config/config.hpp"
#include "helpers/time/Time.hpp"
#include "src/debug/Log.hpp" #include "src/debug/Log.hpp"
#include "src/managers/PointerManager.hpp" #include "src/managers/PointerManager.hpp"
#include "src/version.h" #include "src/version.h"
typedef void (*origRenderSofwareCursorsFor)(void*, SP<CMonitor>, timespec*, CRegion&, std::optional<Vector2D>); typedef void (*origRenderSofwareCursorsFor)(void*, SP<CMonitor>, const Time::steady_tp&, CRegion&, std::optional<Vector2D>);
inline CFunctionHook* g_pRenderSoftwareCursorsForHook = nullptr; inline CFunctionHook* g_pRenderSoftwareCursorsForHook = nullptr;
void hkRenderSoftwareCursorsFor(void* thisptr, SP<CMonitor> pMonitor, timespec* now, CRegion& damage, std::optional<Vector2D> overridePos) { void hkRenderSoftwareCursorsFor(void* thisptr, SP<CMonitor> pMonitor, const Time::steady_tp& now, CRegion& damage, std::optional<Vector2D> overridePos) {
if (isEnabled()) g_pDynamicCursors->renderSoftware((CPointerManager*) thisptr, pMonitor, now, damage, overridePos); if (isEnabled()) g_pDynamicCursors->renderSoftware((CPointerManager*) thisptr, pMonitor, now, damage, overridePos);
else (*(origRenderSofwareCursorsFor)g_pRenderSoftwareCursorsForHook->m_pOriginal)(thisptr, pMonitor, now, damage, overridePos); else (*(origRenderSofwareCursorsFor)g_pRenderSoftwareCursorsForHook->m_pOriginal)(thisptr, pMonitor, now, damage, overridePos);
} }