fix: reintroduce surface updating

close #8
This commit is contained in:
Virt 2024-07-03 14:29:33 +02:00
commit 5cecd4aea3
2 changed files with 16 additions and 1 deletions

View file

@ -16,6 +16,7 @@
#include <hyprland/src/config/ConfigValue.hpp>
#include "hyprland/cursor.hpp"
#include <hyprland/src/protocols/core/Compositor.hpp>
#include <hyprland/wlr/interfaces/wlr_output.h>
#include <hyprland/wlr/render/interface.h>
@ -65,6 +66,9 @@ void CDynamicCursors::renderSoftware(CPointerManager* pointers, SP<CMonitor> pMo
auto zoom = resultShown.scale;
if ((!state->hardwareFailed && state->softwareLocks == 0)) {
if (pointers->currentCursorImage.surface)
pointers->currentCursorImage.surface->resource()->frame(now);
return;
}
@ -94,6 +98,9 @@ void CDynamicCursors::renderSoftware(CPointerManager* pointers, SP<CMonitor> pMo
// now pass the hotspot to rotate around
renderCursorTextureInternalWithDamage(texture, &box, &damage, 1.F, pointers->currentCursorImage.hotspot * state->monitor->scale * zoom, zoom > 1 && **PNEAREST, resultShown.stretch.angle, resultShown.stretch.magnitude);
if (pointers->currentCursorImage.surface)
pointers->currentCursorImage.surface->resource()->frame(now);
}
/*
@ -262,10 +269,12 @@ void CDynamicCursors::onCursorMoved(CPointerManager* pointers) {
}
void CDynamicCursors::setShape(const std::string& shape) {
Debug::log(WARN, "[dynamic-cursors] setting shape {}", shape);
g_pShapeRuleHandler->activate(shape);
}
void CDynamicCursors::unsetShape() {
Debug::log(WARN, "[dynamic-cursors] setting shape to clientside");
g_pShapeRuleHandler->activate("clientside");
}