mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 16:13:21 +02:00
parent
5bd0afd654
commit
ddfea3a29c
1 changed files with 17 additions and 0 deletions
|
@ -328,11 +328,25 @@ void CDynamicCursors::onCursorMoved(CPointerManager* pointers) {
|
|||
if (!pointers->hasCursor())
|
||||
return;
|
||||
|
||||
const auto CURSORBOX = pointers->getCursorBoxGlobal();
|
||||
bool recalc = false;
|
||||
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
auto state = pointers->stateFor(m);
|
||||
|
||||
state->box = pointers->getCursorBoxLogicalForMonitor(state->monitor.lock());
|
||||
|
||||
auto CROSSES = !m->logicalBox().intersection(CURSORBOX).empty();
|
||||
|
||||
if (!CROSSES && state->cursorFrontBuffer) {
|
||||
Debug::log(TRACE, "onCursorMoved for output {}: cursor left the viewport, removing it from the backend", m->szName);
|
||||
pointers->setHWCursorBuffer(state, nullptr);
|
||||
continue;
|
||||
} else if (CROSSES && !state->cursorFrontBuffer) {
|
||||
Debug::log(TRACE, "onCursorMoved for output {}: cursor entered the output, but no front buffer, forcing recalc", m->szName);
|
||||
recalc = true;
|
||||
}
|
||||
|
||||
if (state->hardwareFailed || !state->entered)
|
||||
continue;
|
||||
|
||||
|
@ -340,6 +354,9 @@ void CDynamicCursors::onCursorMoved(CPointerManager* pointers) {
|
|||
m->output->moveCursor(CURSORPOS);
|
||||
}
|
||||
|
||||
if (recalc)
|
||||
pointers->updateCursorBackend();
|
||||
|
||||
// ignore warp
|
||||
if (!isMove && **PIGNORE_WARPS) {
|
||||
auto mode = this->currentMode();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue