mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 08:03:21 +02:00
parent
07a9ca6246
commit
34b5fca47b
4 changed files with 6 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ compile_commands.events.json
|
||||||
out
|
out
|
||||||
.cache
|
.cache
|
||||||
result
|
result
|
||||||
|
notes.md
|
||||||
|
|
|
@ -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())
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue