mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 16:13:21 +02:00
parent
07a9ca6246
commit
34b5fca47b
4 changed files with 6 additions and 4 deletions
|
@ -60,7 +60,7 @@ CDynamicCursors::~CDynamicCursors() {
|
|||
Reimplements rendering of the software 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);
|
||||
|
||||
if (!pointers->hasCursor())
|
||||
|
|
|
@ -25,7 +25,7 @@ class CDynamicCursors {
|
|||
void onTick(CPointerManager* pointers);
|
||||
|
||||
/* 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*/
|
||||
void damageSoftware(CPointerManager* pointers);
|
||||
/* hook on renderHWCursorBuffer */
|
||||
|
|
|
@ -12,13 +12,14 @@
|
|||
#include "globals.hpp"
|
||||
#include "cursor.hpp"
|
||||
#include "config/config.hpp"
|
||||
#include "helpers/time/Time.hpp"
|
||||
#include "src/debug/Log.hpp"
|
||||
#include "src/managers/PointerManager.hpp"
|
||||
#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;
|
||||
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);
|
||||
else (*(origRenderSofwareCursorsFor)g_pRenderSoftwareCursorsForHook->m_pOriginal)(thisptr, pMonitor, now, damage, overridePos);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue